State |
Description
Sets or returns the mode of the ScriptControl object. Read/write.
PowerBASIC Syntax
Arguments
Example [PowerBASIC]
#INCLUDE "MSSCRIPT.INC"
DIM pSc AS IScriptControl DIM strScript AS STRING DIM nState AS LONG
' Create an instance of the Microsoft Script Control pSc = NEWCOM "MSScriptControl.ScriptControl" ' Set the language. It can be "VBScript" or "JScript" pSc.Language = UCODE$("VBScript") ' Deactivate the user interface pSc.AllowUI = %VARIANT_TRUE ' Make an script strScript = "Sub Main" & $CRLF & _ " MsgBox ""Hello everybody.""" & $CRLF & _ "End Sub" pSc.AddCode UCODE$(StrScript) ' Reterieve the state of the ScriptControl object nState = pSc.State IF nState = 0 THEN MSGBOX "State: Initialized" ELSEIF nState = 1 THEN MSGBOX "State: Connected" END IF
|