Versions des environnements
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement