Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SYS(2023) - Temporary Path
Message
De
30/01/2007 19:10:49
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
30/01/2007 18:04:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
01190705
Message ID:
01190720
Vues:
17
>I was given a problem to resolve and found that the offending code was
>
COPY TO &g_proglist TYPE DELIMITED
>
>Of course, the variable contained a space and I know how to fix that. What I'm curious about is how that space got there. The variable is built as follows
>	G_TMPDIR = Sys(2023)
>	G_TMPDIR = Iif(Right(G_TMPDIR,1) = '\', G_TMPDIR, G_TMPDIR + '\')
>	g_proglist = g_tmpdir + SYS(2015) + ".txt"
>	SELECT progtemp
>	COPY TO (g_proglist) TYPE delimited
>
>On my workstation SYS(2023) returns a path with all short names
C:\DOCUME~1\RPUPKO\LOCALS~1\TEMP
but on the user's machine, the path was kind of mixed
C:\DOCUME~1\USERNAME\LOCAL SETTINGS\TEMP
>
>There is no CONFIG.FPW which establishes a TMPFILES directory. I'm curious if anybody knows what Windows setting controls if SYS(2023) returns a path with Long or Short directory names.
>
>Thanks to all........Rich

Your line
COPY TO &g_proglist TYPE DELIMITED
translates into
COPY TO C:\DOCUME~1\USERNAME\LOCAL SETTINGS\TEMP\_20032324.txt TYPE DELIMITED
Since SETTINGS\TEMP\_20032324.txt is the next word after the filename (without quotation marks, VFP parser scans the filename until the first space), VFP can't find it in its keyword tables, and bingo - syntax error.

However, a name expression will work:
COPY TO (g_proglist) TYPE DELIMITED
Use name expressions whenever you have a name of something in a variable - an alias, window name, filename.

[update] Oh now I see you knew this... well I'll leave it here for those who regularly run into that sort of problems. We seem to have one of those few times each month.

Well, check getenv("temp") and see what it returns. If you don't have TMPFILES set in your config.fpw, the temp files should go there, and that's what SYS(2023) is using (I think). The actual location differs from OS to OS, and may also depend on user's settings - "my documents" may be moved elsewhere from the default location.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform