Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Paths & drive letter referencing over network applicatio
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00091853
Message ID:
00091861
Vues:
23
>Hi there,
>I have a simple windows 95 peer to peer network of about 8 computers.
>
>In my last fpw2.6 application, all my files making up the application were dumped together in one directory/folder. Other computers on the network could access this application by simply mapping a drive letter (D: or E: or F: etc) to this folder, and then running the application.
>
>Now I have done things the 'correct' way and have my various files separated into subdirectories such as "data","menus","forms" etc.
>However, I have now had to use path referencing such as "do form c:\app\forms\form1.scx". This now causes problems for other computers on the network, because it looks for these files on their c: drives.
>
>I have tried changing the path to \\computername\app\forms\form1.scx but then I get an error: 'file already in use' on my computer.
>
>What I have done so far is to place the following in my 'startup' program:
>
>store sys(5) to mcDrive && store that computers mapped drive letter
> if sys(5) = "c:" && and it is my computer
> store "c:\app" to mcDrive && include this only for my computer
> endif
>
>Then I have changed paths to include the &mcDrive as follows:
>
>do form &mcDrive\forms\form1.scx
>
>Is this the best way of getting around this path problem? Any suggestions?
>
>Many Thanks

You can use the SYS(5) to identify which drive letter is in use. As so:
STORE SYS(5)+':' TO lcDrive
IF lcDrive="C:"
    lcDrive=lcDrive+"\app"
ENDIF
lcFormName=lcDrive+"\forms\form1.scx"
DO FORM (lcFormName)
This will then store the form name (with the correct drive) in the variable lcFormName and run it. This only works if the other PC user runs from the drive mapped to your path. Another option would be for you to use ADIR() with the 'V' option - return=ADIR(array,"D:\",'V') - this will store the server/volume name in the array - try it and see.
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform