Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using variables in DOS
Message
De
10/09/2007 19:39:28
 
 
À
03/09/2007 10:11:22
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Versions des environnements
Visual FoxPro:
FoxPro Dos
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01251953
Message ID:
01253587
Vues:
25
Although Dragan's method sounds somewhat Rube Goldberg-ish, it's pretty much how many DOS-based menu programs worked. The alternative to this would be something that is strongly dependent on how DOS does things. Basically it involves a binary module (often created in assembler) which you LOAD into memory and then CALL. All the binary module has to do is to locate the environment memory block and modify its contents. From the FoxPro side it'll look pretty simple:

LOAD SETDOSV.BIN
CALL SETDOSV "MyVar=A Value"

The actual implementation of the module however could get a bit tricky -- especially when the environment memory block turns out to be too small to contain the environment variable you want to set. This is often the reason why you see the DOS-based menuing programs allocate a few dummy variables in the batch file (to "pad out" the environment memory area so that there will be enough space for additional variables). It's been a while since I last wrote such .BIN files (typically in assembler or in C) -- essentially stopped once I started writing stuff for Windows (where usage of such BIN files is not only frowned upon, but is not guaranteed to work).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform