Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drive mappings
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00082789
Message ID:
00082801
Views:
41
>Hello. Having trouble hard-coding drive assignments in visual foxpro for users on a network in Win95. To some users a shared network drive is one letter and to another user it's another. Is there a good way to reference "use t:Thisfile" as opposed to "use S:thisfile"?
>Thanks

Timothy,

In addition to Ed's suggestion, you could create a function to determine what drives were network drives and, using the FILE() function look for the file. Note that what follows requires that FOXTOOLS be loaded.


FUNCTION NetFile
* Checks all network drives for the
* existence of a file
LPARAMETER pcfile
* The fully qualified file name
LOCAL lni, lcfile, lldone, lcdrive, lcresult
STORE "" TO lcdrive, lcresult
lni = 69
lldone = .F.
lcfile = pcfile
IF NOT EMPTY(JustDrive(lcfile))
lcfile = SUBSTR(lcfile, 3)
ENDIF
DO WHILE lni < 90 AND NOT lldone
lni = lni + 1
lcdrive = CHR(lni) + ":"
IF DriveType(lcdirve) = 4
lldone = FILE(lcdrive + lcfile)
ENDIF
ENDDO
IF lldone
* Found it
lcresult = lcdrive
ENDIF
RETURN lcresult

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform