AddCode Method

 

Description

 

Adds specified code to a module.

 

PowerBASIC Syntax

 

METHOD AddCode (BYVAL bstrCode AS STRING)

 

Arguments

 

bstrCode

BSTR. String containing code being added to the object.

 

Remarks

 

AddCode may be called multiple times.

 

Example [PowerBASIC]

 

#INCLUDE "MSSCRIPT.INC"

 

DIM pSc AS IScriptControl

DIM strScript AS STRING

 

pSc = NEWCOM "MSScriptControl.ScriptControl"

pSc.Language = UCODE$("VBScript")

pSc.AllowUI = %VARIANT_TRUE

pSc.TimeOut = 1000

strScript = "Sub Main" & $CRLF & _

            "   For i = 1 to 10000000" & $CRLF & _

            "      x = x + i" & $CRLF & _

            "   Next" & $CRLF & _

            "   Msgbox ""Done"" " & $CRLF & _

            "End Sub"

pSc.AddCode UCODE$(StrScript)

 

Valid XHTML 1.0 Transitional