Interpreter

(requires: Interactive Advanced Macro - API)

DeleteVariable, DeleteVariables, Enable_Interrupt_InScript, ExistConst, ExistProc, ExistVariable, RegisterConst, RegisterProc, ShowVars, UnregisterProc, VariablesUpdate

DeleteVariable

Description 

 DeleteVariable(
   char *Name
);

This function deletes a variable of the specified name.

Parameters

char *Name

Name.

DeleteVariables

Description 

 DeleteVariables(
   char *Name
);

Deletes variables whose name starts with the given Name.

Parameters

char *Name

Beginning of variable names.

NULL, ""

All variables.

Enable_Interrupt_InScript

Description 

 Enable_Interrupt_InScript(
   int  Enabled
);

This function sets behaviour of a macro while it is paused by the user.

0 = macro cannot be interrupted, 1 = interruption is enabled, but it is not possible to use the user interface while paused, 2 = interruption is enabled and it is possible to use the user interface (toolbar, menu commands, hotkeys).

Parameters

int Enabled

0

Disabled.

1

Enabled.

See Also 
Int_GetEvents

ExistConst

Description 

 ExistConst(
   char *ProcName
);

This function checks if the constant (procedure) exists.

Parameters

char *ProcName

Name of the procedure.

Return Values

The function returns TRUE, if the constant exits. Otherwise returns FALSE.

ExistProc

Description 

int ExistProc(
   char *Name
);

Checks if a function of the given name exists.

Parameters

char *Name

Name.

Return Values

int

0, FALSE

Function does not exist.

1, TRUE

Function exists.

if(ExistProc("_InputSetup") == TRUE)
   WaitText(0, "Function _InputSetup exists");
else
   WaitText(0, "Function _InputSetup does not exist");

See Also 
ExistVariable

ExistVariable

Description 

 ExistVariable(
   char *Name
);

This function checks if a variable of the given name exists.

Parameters

char *Name

Name.

Return Values

The function returns TRUE, if the variable exits. Otherwise returns FALSE.

//ExistVariable example - tests if variable and/or procedure exists.
char      name[256],caption[256];
int       res,qw;
strcpy(caption,"API Example - ExistVariable, ExistProc functions");
Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);
again:
qw=Int_Question("LIM API Example","Which test?","&Variables","&Procedures","&Exit","",1,0);
if(qw==1)
   {
   Int_GetString("API Example","Choose name of the variable for test:",name,32);
   if(strlen(name) == 0) res = FALSE;
   else res = ExistVariable(name);
   if(res==TRUE)
   Int_Question("API Example","Varible exists.","OK","","","",1,0);
   else
   Int_Question("API Example","Varible does not exist.","OK","","","",1,0);
   }
if(qw==2)
   {
   Int_GetString("API Example","Choose name of the procedure for test:",name,32);
   res = ExistProc(name);
   if(res==TRUE)
   Int_Question("API Example","Procedure exists.","OK","","","",1,0);
   else
  Int_Question("API Example","Procedure does not exist.","OK","","","",1,0);
   }
if(qw==3)
   goto end;
goto again;
end:
Int_CloseTextWindow();

See Also 
ExistProc

RegisterConst

Description 

int RegisterConst(
   char *Name,
   char *value
);

This function registers a numeric value as a named constant. You can then use the Name as a synonym for the declared value.

Parameters

char *Name

Name.

char *value

String which defines the value of the constant

Return Values

int

Note

This function registers constant dynamically when called. Command RegisterConst("TRUE (1)","1"); is equivalent to #define TRUE (1) 1.

RegisterProc

Description 

int RegisterProc(
   char *module,
   int  ret_type,
   int  ret_ind,
   char *ProcName,
   int *params,
   int *indirections,
   char *parnames
);

This function registers the procedure dynamically when called.

Parameters

char *module

Module (*.dll) where is the function declared. The path to the module should be here specified.

int ret_type

Type of the variable which is returned.

0

NULL

1

CHAR

2

BYTE

3

SHORT

4

WORD

5

INT

6

LONG

7

DWORD

8

DOUBLE

9

pointer

10

string pointer

int ret_ind

Return indirection.

0

The value is returned.

1

The pointer is returned.

char *ProcName

Name of the procedure.

int *params

Array of parameter types.

1

CHAR

2

BYTE

3

SHORT

4

WORD

5

INT

6

LONG

7

DWORD

8

DOUBLE

9

pointer

10

string pointer

-1

marks end of this array

int *indirections

Array of parameter indirections.

char *parnames

Array of parameter names. String allocated for one name should be 32 characters long.

Return Values

int

Note

This function registers procedure dynamically when called.

See Also 
UnregisterProc

ShowVars

Description 

 ShowVars(
   char *Name,
   int  status
);

This function shows the list of variables and their values.

Parameters

char *Name

Beginning of variable names.

NULL, ""

All variables.

int status

Variable type.

0

Default.

1

Global variables.

2

Local variables.

3

Constants.

Return Values

Unused.

// ShowVars example - shows the selected type of variables.
int   qw;
Int_CreateTextWindow("API Example - ShowVars function.",0,RGB(0,0,255),RGB_WHITE,100);
qw = Int_Question("API Example","Display variables:","Global","Local","Constants","",1,0);
if(qw == 1)
   ShowVars("",1);
if(qw == 2)
   ShowVars("",2);
if(qw == 3)
   ShowVars("",3);
Int_CloseTextWindow();
UnregisterProc

Description 

 UnregisterProc(
   char *ProcName
);

This function unregisters a procedure dynamically when called.

Parameters

char *ProcName

Name of the procedure.

See Also 
RegisterProc

VariablesUpdate

Description 

 VariablesUpdate(
   char *VarName
);

This function updates variables' values in the Variables control.

Parameters

char *VarName

Variable name.