Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sys(5) problem
Message
From
16/10/2002 04:42:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/10/2002 14:14:23
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00711411
Message ID:
00711609
Views:
7
>Windows XP Professional: (Not SP1). VFP 7 SP1
>
>Assume machine name to be XPBox. Single User as Administrator set-up, uses logon. Has installed all programs as the same user. No other accounts have been set up. The C:\ drive is shared, and includes all folders.
>
>A Delphi menu program uses a drive box, folder box, and a file name (¶meter) box. The parameter is used when the program is run in a network environment. The parameter is the drive letter and folder of the DBC and tables. If blank, the DBC is found in the drive\folder\ path.
>
>The menu calls a VFP7 program using (drive&folder&filename(parameter)).
>
>On this particular machine, although the program was run from C:\folder\filename, the SYS(5) command returns \\XPBox\c.
>
>Creating a shortcut on the desktop to c:\folder\filename runs the exact same exe, in the same folder, but now SYS(5) returns C:\.
>
>Problem is that a shortcut built into the VFP program to call another program uses SYS(5)&FOLDER2\FILENAME. The program runs, but a data file the program is dependent on is not found. When the VFP program is run from the desktop shortcut, the data file in the second program is opened successfully. Why does sys(5) return different values?

As documented sys(5) return default drive not the drive where exe reside. If it's called from an appliacation that uses \\XPbox\c as working dir it'd return \\XPBox\c. Invoking from its own shortcut returns c: because its shortcut has a 'Start in' folder somewhere along c:. To get exe's drive use :
justdrive(sys(16))
or :
justdrive(Application.ServerName)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform