// 외부 함수 선언
FUNCTION long GetEnvironmentVariableA( string lpszName, ref string lpszValue, long lLen ) LIBRARY "kernel32.dll" alias for "GetEnvironmentVariableA;ansi"
/* 실 사용예*/
string ls_value, ls_name[]
integer i, i_len = 1024
// 환경변수 리스트 만들기
ls_name[ UpperBound( ls_name ) + 1] = 'ALLUSERSPROFILE'
ls_name[ UpperBound( ls_name ) + 1] = 'APPDATA'
ls_name[ UpperBound( ls_name ) + 1] = 'COMMONPROGRAMFILES'
ls_name[ UpperBound( ls_name ) + 1] = 'COMPUTERNAME'
ls_name[ UpperBound( ls_name ) + 1] = 'COMSPEC'
ls_name[ UpperBound( ls_name ) + 1] = 'FP_NO_HOST_CHECK'
ls_name[ UpperBound( ls_name ) + 1] = 'HOMEDRIVE'
ls_name[ UpperBound( ls_name ) + 1] = 'HOMEPATH'
ls_name[ UpperBound( ls_name ) + 1] = 'LOCALAPPDATA'
ls_name[ UpperBound( ls_name ) + 1] = 'LOGONSERVER'
ls_name[ UpperBound( ls_name ) + 1] = 'NUMBER_OF_PROCESSORS'
ls_name[ UpperBound( ls_name ) + 1] = 'OS'
ls_name[ UpperBound( ls_name ) + 1] = 'PATH'
ls_name[ UpperBound( ls_name ) + 1] = 'PATHEXT'
ls_name[ UpperBound( ls_name ) + 1] = 'PBNET_HOME'
ls_name[ UpperBound( ls_name ) + 1] = 'PROCESSOR_ARCHITECTURE'
ls_name[ UpperBound( ls_name ) + 1] = 'PROCESSOR_IDENTIFIER'
ls_name[ UpperBound( ls_name ) + 1] = 'PROCESSOR_LEVEL'
ls_name[ UpperBound( ls_name ) + 1] = 'PROCESSOR_REVISION'
ls_name[ UpperBound( ls_name ) + 1] = 'PROGRAMDATA'
ls_name[ UpperBound( ls_name ) + 1] = 'PROGRAMFILES'
ls_name[ UpperBound( ls_name ) + 1] = 'PROMPT'
ls_name[ UpperBound( ls_name ) + 1] = 'PSMODULEPATH'
ls_name[ UpperBound( ls_name ) + 1] = 'PUBLIC'
ls_name[ UpperBound( ls_name ) + 1] = 'SQLANY12'
ls_name[ UpperBound( ls_name ) + 1] = 'SQLANYSAMP12'
ls_name[ UpperBound( ls_name ) + 1] = 'SYSTEMDRIVE'
ls_name[ UpperBound( ls_name ) + 1] = 'SYSTEMROOT'
ls_name[ UpperBound( ls_name ) + 1] = 'TEMP'
ls_name[ UpperBound( ls_name ) + 1] = 'TMP'
ls_name[ UpperBound( ls_name ) + 1] = 'USERDOMAIN'
ls_name[ UpperBound( ls_name ) + 1] = 'USERNAME'
ls_name[ UpperBound( ls_name ) + 1] = 'USERPROFILE'
ls_name[ UpperBound( ls_name ) + 1] = 'WINDIR'
mle_1.text = ''
// 환경변수값 읽어오기
for i = 1 to UpperBound( ls_name )
ls_value = space( i_len )
GetEnvironmentVariableA( ls_name[i], ls_value, i_len )
mle_1.text += ls_name[i]+ space(22 - Len(ls_name[i])) + ': '+ Trim(ls_value) + '~r~n'
next