Please enable JavaScript to view this site.

 

bool = IsInitialized(anyGlobalVariable)

 

This macro function checks if the global variable anyGlobalVariable has been initialized.

 

This function accepts any type of variable.

It only accepts global variables as parameter. If you try to pass any other variable than a global variable, you will get a compilation error.

 

Because this function tests the state of a variable, you cannot pass literals to it.

 

The macro code below uses a variable to specify the maximum length of text that will fit in a box. This is a global variable which only needs to be set once.

global
    nMaxTextWidth
var
begin
    sResult = ''
    if not IsInitialized(nMaxTextWidth)
        nMaxTextWidth = TextWidth('Darwin reached Galapagos Islands, 1835''Arial', false)
    endif
end

See also: global variables.

 


Topic 110033, last updated on 18-Apr-2020