The LazyBoy Library Manual - GetEnvKey

Part of the System group.

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

Return a register pair pointer to 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 entire 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:

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

See also GetEnvVal.