Topic : TOS - The Operating System Author : Version : tos.hyp (December 19, 2008) Subject : Programmieren/Atari Nodes : 3010 Index Size : 93790 HCP-Version : 5 Compiled on : Atari @charset : atarist @lang : @default : Title @help : @options : +g -i -s +x +zz -t4 @width : 70 View Ref-File8.18.1 shel_envrn TOS Name: »Shell environment« - Obtains value of environmental variables. Opcode: 125 Syntax: int16_t shel_envrn ( int8_t **sh_epvalue, int8_t *sh_eparm ); Description: The call shel_envrn searches the current environment string to find the value of a specific environmental variable of the AES. The following apply: Parameter Meaning sh_epvalue Name of the environmental variable sh_eparm After the call contains the value of the corresponding variable Example: If the current environment is, say: 'PATH=C:\;D:\;E:\' then calling shel_envrn with sh_eparm pointing to the string 'PATH=' would set the pointer pointed to by sh_epvalue to the start of the string 'C:\;D:\;E:\'. Note that the character string pointed to by sh_eparm should include the name of the variable and the 'equals' sign. Note: To change the AES environment, one should hook into the exec_os vector, which is also used to launch GEM. In the called routine, the basepage pointer lies on the stack (as in a program). In this basepage one can then simply enter a pointer to the new environment. But a word of warning: In AES versions lower than 1.4, only the first 50 bytes will be adopted; also these only accept semicolons as separators between multiple 'PATH=' arguments, while later versions accept commas as well. Another tip: If the pointer returned for 'PATH=' points to a NULLbyte, one should increase it by the value 1 to get the correct result. Return value: The function always returns a value of 1. Availability: All AES versions. Group: Shell library See Also: Binding