Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table not closing
Message
From
10/06/2016 12:56:05
 
 
To
09/06/2016 14:17:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01637157
Message ID:
01637234
Views:
85
Please note the following is highly opinionated diatribe by someone who was one of those bratty kids who learned to program BASIC on "trash-eighty" back in the early 1980s (and forever had his thought processes mangled beyond all hope and essentially crippled because of the bad habits learned).

Your use of macro expansion is apt to create a few "gotchas" that might not be so straightforward to debug. Take for instance the code:
thiswebfile=&mwebpath+'jobsweb.dbf'
thiswebfile1=&mwebpath+'applweb.dbf'
With this context, then it means that the value contained in mwebpath should contain an expression that would evaluate as the path rather than the path itself. To clarify what I mean, I'll simply insert a line that assigns mwebpath to the line above and let's see what we get:
mwebpath = "v:\"
thiswebfile=&mwebpath+'jobsweb.dbf'
After macro expansion, the second line would be:
thiswebfile=v:\+'jobsweb.dbf'
which will result in an error.

To correct this we must change the
mwebpath = "v:\"
to
mwebpath = "'v:\'"
(note the quotes within quotes type of string constant) so that the following line would expand as:
thiswebfile='v:\'+'jobsweb.dbf'
As previously stated by several other members on the board, your code as presented will still encounter problems if you've got paths or filenames that contain embedded spaces. To get around this, and still use macro expansions, you'll have to start quoting those spaces, then quoting those quotes... yuck. Name expression in the USE statement is probably a better way.

>Hi Koen..
>
>mwebpath is different for most of the PC's, depending on how their drive mapping is set up, which I can't change, so it has to be a variable, and not hard coded. To answer your question, it will be something like "v:\", etc.
>
>On there server that houses the web files, the files are open all the time in multiple instances of a web app. I don't want them left open in multiple instances over the network over a long period by a desktop app that posts to them maybe a few times a day, and for very short periods, so I open them, post stuff to them quickly, and close them again.
Previous
Reply
Map
View

Click here to load this message in the networking platform