Windows API
ID #1020
How to read from application environment variable?
You need use Windows API function GetEnvironmentVariable. Let see the example for reading of content %TEMP%:
MAP MODULE('kernel32.lib') GetEnvironmentVariable(*CSTRING lpName,*CSTRING lpBuffer,ULONG nSize), | ULONG,RAW,PASCAL,PROC, END END
! Data Section EnvVariable CSTRING('TEMP') EnvVariableBuffer CSTRING(255) EnvVariableSize ULONG
! Code Section EnvVariableSize = SIZE(EnvVariableBuffer) GetEnvironmentVariable(EnvVariable,EnvVariableBuffer,EnvVariableSize) MESSAGE('Your temporary directory is: ' & EnvVariableBuffer)
Tags: environment
Related entries:
- How to prevent running of Application Wizard creating new application?
- How to change first calling procedure when application started?
- What is the error "Internal error 1: WSLDIAL"?
- How to know if user leave the application?
- How to run application that will not be displayed in task bar?
Last update: 2007-07-17 09:30
Author: Aleksey Timkov
Revision: 1.6
You can comment on this entry