Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Behavior
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Strange Behavior
Miscellaneous
Thread ID:
00128823
Message ID:
00128823
Views:
56
The following code is involved in an application I'm trying to distribute, but it is behaving differently depending on where it is run from. I can't understand why.

Assume a directory structure like this:

C:
\DIR1
\DIR2
\FIRST
\BASE

The program is run from a directory (C:\DIR1) containing a .DBF called 'filloc' in it. The contents of the 'data' field contain a path (for this example, 'C:\DIR2\FIRST\'). The commands are then simply to go up one level (to DIR2) and then down into the sub-directory BASE where the program will contiue.

I put in the 'test' window for debugging and that's when the odd behavior really began.

Here are 3 scenarios:

1) If I run the program from within VFP, it executes perfectly.

2) If I create an executable and put it in C:\DIR1 and run it, the messages that show up in the test window are all the same: 'C:\DIR2\FIRST'. For some reason, the 'CD ..' command has no effect in this case. I get an 'Invalid path or filename' error after the second message because the program is trying to change to 'BASE' directly from 'FIRST'.

3) If I put the executable in a separate directory on another drive with the line 'SCREEN = OFF' in the CONFIG.FPW file, it doesn't show the 'test' window at all, but it runs fine.

Any help with this would be greatly appreciated as it has me completely baffled.

TIA,
Rob

Here's the code:

DEFINE WINDOW test;
FROM 20,40 TO 30,100;
IN DESKTOP;
TITLE 'Current Directory'

ACTIVATE WINDOW test

USE filloc
m.home=RTRIM(filloc.data)
SET DEFAULT TO (m.home)

? FULLPATH(CURDIR())
WAIT '' TIMEOUT 1

CD ..

? FULLPATH(CURDIR())
WAIT '' TIMEOUT 1

CD base

? FULLPATH(CURDIR())
WAIT '' TIMEOUT 1

RELEASE WINDOW test
Next
Reply
Map
View

Click here to load this message in the networking platform