interesting program
Richard Kreiss
rkreiss at verizon.net
Wed Mar 3 12:48:30 PST 2010
Problem:
Client needs to move filepro data from office computer to home computer using a usb drive.
Drive letter on home computer changes periodically.
I wrote this program to find the drive letter of the drive and run proper batch file to either copy from the computer or to the computer using xcopy.
If anyone has a more efficient way do doing this, I am open to suggestions.
───────────────────────────────────────────────────────────────────────────────
8 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: declare drive,usb_drive,where,runthis
9 ------- - - - - - - - - - - - - - - - -
◄ If: 'uncommented if running from *report
Then: 'END
10 ------- - - - - - - - - - - - - - - - -
@once ◄ If: '******************************************************
Then: '* get file name to import
11 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: bs=chr("92")
12 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: drive="C"
13 ------- - - - - - - - - - - - - - - - -
◄ If: usb_drive = ""
Then: usb_drive=drive
14 ------- - - - - - - - - - - - - - - - -
loop_dr◄ If: 'get drive letter for usb drive
Then: zz=asc(usb_drive)+"1";usb_drive=chr(zz)
15 ------- - - - - - - - - - - - - - - - -
◄ If: usb_drive = "Z"
Then: ERRORBOX "USB Drive Not Found";EXIT
16 ------- - - - - - - - - - - - - - - - -
◄ If: 'can be any file name on usb drive that will always be there
Then: where=usb_drive{":"{bs{"move.bat"{""
17 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: qq=exists(where)
18 ------- - - - - - - - - - - - - - - - -
◄ If: qq le "0"
Then: GOTO loop_dr
19 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: dim rifka(3)
20 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: rifka["1"]="Select Option"
21 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: rifka["2"]="1: Save to USB Drive"<usb_drive
22 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: rifka["3"]="2: Copy from USB Drive"<usb_drive<"to Computer"
23 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: menu rifka saveit,copyit,done
24 ------- - - - - - - - - - - - - - - - -
done ◄ If:
Then: EXIT
25 ------- - - - - - - - - - - - - - - - -
copyit ◄ If: 'copy from usb drive to computer
Then: runthis=usb_drive{":"{"move_from_computer.bat"{usb_drive;GOTO doit
26 ------- - - - - - - - - - - - - - - - -
saveit ◄ If: 'copy from computer to usb drive
Then: runthis=usb_drive{":"{"move_to_usbdrive.bat"<usb_drive{"";GOTO doit
27 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: END
28 ------- - - - - - - - - - - - - - - - -
doit ◄ If:
Then: system runthis{""
29 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: EXIT
Have printer issues as he uses a dot matrix printer at home which is not in the office.
Richard Kreiss
GCC Consulting
rkreiss at gccconsulting.net
More information about the Filepro-list
mailing list