17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

ENVIRON Statement<br />

Purpose:<br />

To allow the user to modify parameters in GW-BASIC's environment string table. This may be to<br />

change the path parameter for a child process, (see ENVIRON$, SHELL, and the MS-DOS<br />

utilities PATH command), or to pass parameters to a child by inventing a new environment<br />

parameter.<br />

Syntax:<br />

ENVIRON string<br />

Comments:<br />

string is a valid string expression containing the new environment string parameter.<br />

string must be of the following form<br />

parmid=text<br />

where parmid is the name of the parameter such as PATH.<br />

parmid must be separated from text by an equal sign or a blank. ENVIRON takes everything to<br />

the left of the first blank or equal sign as the parmid; everything following is taken as text.<br />

text is the new parameter text. If text is a null string, or consists only of a single semicolon,<br />

then the parameter (including parmid=) is removed from the environment string table, and the<br />

table is compressed. text must not contain any embedded blanks.<br />

If parmid does not exist, then string is added at the end of the environment string table.<br />

If parmid does exist, it is deleted, the environment string table is compressed, and the new string<br />

is added at the end.<br />

Examples:<br />

Assuming the environment string table is empty, the following statement will create a default<br />

path to the root directory on Disk A:<br />

ENVIRON "PATH=A:\"<br />

If your work subdirectory were john, you would be able to get DEBUG from the root.<br />

A new parameter may be added:<br />

ENVIRON "COMSPEC=A:\COMMAND.COM"<br />

The environment string table now contains<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/ENVIRON.html (1 of 2)28/03/2004 21.29.23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!