Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Program looking at wrong table
Message
De
16/05/2013 13:02:17
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01573918
Message ID:
01574109
Vues:
48
We had run into similar sort of problems -- typically when printing. So what we did was to save the current directory, print, then reset the current directory:
lcOrgDir = SYS(5)+SYS(2003)

REPORT ....

SET DEFAULT TO (m.lcOrgDir)
You may also find that some system dialogs that do equivalent of GETFILE(), PUTFILE(), GETDIR(), FINDFILE() will sometimes change the current directory -- in those cases you can do a similar bit of saving the current directory before the operation, then restoring it. Another approach is to simply have a global setting for "current directory" for your application -- then restore the current directory as required (often in cases where certain system dialogs that change current directory gets changed, or in cases where an external program might change the current directory).

>I've put the code below, I do this with 3 files, all in the same way, use the file, do something very quickly over 10-12 lines of code and then unuse the file at the end. The NWC table is in use from the data environment in company 1 but the other folder has a NWC so the reference I use is NW_NWC to avoid complications. The othercompanyNWC variable holds the path to the other file \\serverz\main_folder\company2\table_NWC but I don't move the default folder.
>One other user who does not use the 2 systems has reported problems when using foxit pdf. They installed it and started to use it, but when she prints to the foxitpdf and saves the file on the desktop it seems to mess up the application like the default folder has been changed.
>
>
>SELECT 0
>USE &othercompanyNWC ALIAS 'NW_NWC'
>SELECT NW_NWC
>
>SEEK mcallnum ORDER CMA_calnum
>IF FOUND()
>	IF CMA_stage = "20"
>		REPLACE CMA_stage WITH "23"
>	ELSE
>		WAIT WINDOW "Stage not 20 in Other Company" TIMEOUT 3
>	ENDIF
>ELSE
>	* should not happen
>	WAIT WINDOW "Cannot find original transaction" TIMEOUT 3
>ENDIF
>
>SELECT NW_NWC
>USE
>
>~M
>
>>The only thing that comes to mind, assuming that you are doing some form of
>>
>>Select thattable
>>use
>>
>>Could there be a changing of the default directory?
>>
>>
>>>Hi all,
>>>
>>>I hit a problem today that puzzles me. I have a customer with 2 different applications but both have the same table structure behind them, just in different folders. The relevant tables are in the data environment of each. However I made a change today where in program1 I use the table1 from the folder containing program2, update a field and then use the table to release it. However when further processing was done in program1 it continued to update fields in the folder for program2. any ideas?
>>>
>>>~M
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform