Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#os4units]

GetVar

Returns the value of a local or global variable

Declaration

Source position: amigados.pas line 2592

function GetVar(

  const Name: PChar;

  Buffer: PChar;

  Size: LongInt;

  Flags: LongInt

):LongInt;

Arguments

Name

  

Pointer to a variable name.

Buffer

  

A user allocated area which will be used to store the value associated with the variable.

Size

  

Length of the buffer region in bytes.

Flags

  

combination of type of var to get value of (low 8 bits), and flags to control the behavior of this routine.

Function result

Size of environment variable. -1 indicates that the variable was not defined.

Description

Gets the value of a local or environment variable. It is advised to only use ASCII strings inside variables, but not required. This stops putting characters into the destination when a n is hit, unless GVF_BINARY_VAR is specified. (The n is not stored in the buffer.)

Currently defined flags include:

GVF_GLOBAL_ONLY
tries to get a global env variable.
GVF_LOCAL_ONLY
tries to get a local variable.
GVF_BINARY_VAR
don't stop at n
GVF_DONT_NULL_TERM
no null termination (only valid for binary variables).

The default is to try to get a local variable first, then to try to get a global environment variable.

See also

SetVar

  

Sets a local or environment variable

DeleteVar

  

Deletes a local or environment variable

FindVar

  

Finds a local variable


Documentation generated on: 2021-07-30