Function.Unofficial.General

From GAB Help
Jump to: navigation, search

Available commands

Function.Unofficial.Script.AddCode

Adds code to project

Syntax

Function.Unofficial.Script.AddCode(String)

Arguments

String

String of code (good if used with Function.Intrinsic.File.File2String)

Example

Function.Unofficial.Script.AddCode(variable.local.sText)

Remarks


Function.Unofficial.Script.AllowUI

Syntax

Function.Unofficial.Script.AllowUI(Boolean)

Arguments

Boolean

True or False

Example

Function.Unofficial.Script.AllowUI(True)

Remarks


Function.Unofficial.Script.Eval

Evaluation Script ; can use with strings, integers, or boolean statements

Syntax

function.Unofficial.Script.Eval(Passed Function, f Ret)

Arguments

Passed Function

String, boolean statement of action

F Return

String Return of evaluation/action

Example

#1
Program.Sub.Main.Start
 variable.local.a.declare(float)
 variable.local.b.declare(float)
 variable.local.c.declare(float)
 variable.local.r.declare(float)
 variable.local.a.set(2)
 variable.local.b.set(3)
 variable.local.c.set(4)
 'variable.local.s.set("[variable.local.a]*[variable.local.b]^[variable.local.c]")
function.unofficial.script.eval("[variable.local.a]*[variable.local.b]^
[variable.local.c]",variable.local.r)
function.intrinsic.ui.msgbox(variable.local.r)
'this should give 162
                    function.unofficial.script.eval("([variable.local.a]*[variable.local.b])^[variab le.local.c]",variable.local.r)
function.intrinsic.ui.msgbox(variable.local.r)
'this should give 1296
Program.Sub.Main.End

#2
Program.Sub.Main.Start
 variable.local.a.declare(long)
 variable.local.b.declare(long)
 variable.local.c.declare(long)
 variable.local.s.declare(string)
 variable.local.r.declare(long)
 variable.local.a.set(1)
 variable.local.b.set(2)
 variable.local.c.set(3)
 function.intrinsic.string.concat(variable.local.b,"=",variable.local.b," and ",variable.local.a,"=",variable.local.c,variable.local.s)
 function.unofficial.script.eval("[variable.local.s]",variable.local.r)
 'returns -1 for false
 function.intrinsic.control.if(variable.local.r,"=",0)
 function.intrinsic.string.concat("The condition ",variable.local.s," was false",variable.local.s)
 function.intrinsic.ui.msgbox(variable.local.s)
 function.intrinsic.control.elseif(variable.local.r,"<>",0)
 function.intrinsic.string.concat("The condition ",variable.local.s," was true",variable.local.s)
 function.intrinsic.ui.msgbox(variable.local.s)
 function.intrinsic.control.endif
function.intrinsic.string.concat(variable.local.b,"=",variable.local.b," and “,variable.local.a,"=",variable.local.a,variable.local.s)
function.unofficial.script.eval("[variable.local.s]",variable.local.r)
'returns 0 for true
function.intrinsic.control.if(variable.local.r,"=",0)
function.intrinsic.string.concat("The condition ",variable.local.s," was false",variable.local.s)
function.intrinsic.ui.msgbox(variable.local.s)
function.intrinsic.control.elseif(variable.local.r,"<>",0)
function.intrinsic.string.concat("The condition ",variable.local.s," was true",variable.local.s)
function.intrinsic.ui.msgbox(variable.local.s)
function.intrinsic.control.endif
Program.Sub.Main.End 

Remarks

  • Passed variables in the function must be denoted with square brackets


Function.Unofficial.Script.ExecuteStatements

Syntax

Function.Unofficial.Script.ExecuteStatement(String Statement)

Arguments

String Statement

VBScript to Execute

Example

Function.Unofficial.Script.ExecuteStatement(variable.local.sScript)

Remarks


Function.Unofficial.Script.ExecuteStatment

Syntax

Function.Unofficial.Script.ExecuteStatment(Passed statement)

Arguments

Passed statement

Example

Remarks


Function.Unofficial.Script.Reset

Syntax

Function.Unofficial.Script.Reset

Arguments

Example

Remarks


Function.Unofficial.Script.Run

Runs Program/SubRoutine with Parameters

Syntax

Function.Unofficial.Script.Run(Sub, Param, Param, Param)

Arguments

Sub

Subroutine name

Param

There can be up to 9 separate parameters listed, separated by a comma

Example

Function.Unofficial.Script.Run(“Add2Numbers”, 12, 39) 

Remarks

  • Runs a sub from added code


Function.Unofficial.Script.SethostHwnd

Syntax

Function.Unofficial.Script.SetHostHwnd(Long)

Arguments

Long

Window Handle for Host

Example

Function.Unofficial.Script.SetHostHwnd(1)

Remarks