The LazyBoy Library Manual - GetEnvVal

Part of the System group.

%imacro GetEnvVal 2
Prefers: ES:DI, SI
Prefers: ES:DI, label

Return a register pair pointer to the value portion of a string in the environment variable table for the KEY provided. The Carry Flag will be set if the key is not found.

%1 is the return pointer to either the value portion of the string or a null string.

%2 is the pointer to a search key string. If no segment is provided, DS will be assumed. Unless %2 is a code label, then CS will be assumed. Also, accepts a hard coded string as well.

Examples:

    GetEnvVal dx:ax, VAR_NAME   ; Search env for string CS:VAR_NAME, return DX:AX
    GetEnvVal es:di, si         ; Search env for string at memory location ds:si
    GetEnvVal es:di, dx:ax      ; Search env for string at memory location dx:ax
    GetEnvVal es:di, "PATH"     ; Search env for "PATH" key

See also GetEnvKey.