hexagon logo

No ENDSCRIPT?

I'm desparately trying to get the sample code running in 4.2. Using the code editor, I create a sample file, testscript.bas:

Sub main

Dim app As Object
Set app = createobject("PCDLRN.Application")
Dim part As Object
Set part = app.activepartprogram
Dim var As Object
Set var = part.getvariablevalue("V2")
If Not var is Nothing Then
msgbox "Starting Script = " & var.longvalue
var.longvalue = var.longvalue + 1
msgbox part.setvariablevalue("V2", var)
Else
msgbox "Var not there"
End If
End Sub

The code in the part program:

C2 =COMMENT/INPUT,NO,'Enter V2'
ASSIGN/V2 = INT(C2.INPUT)
CS1 =SCRIPT/FILENAME= C:\PROGRAM FILES\WAI\PC-DMIS V42\TESTSCRIPT.BAS
FUNCTION/Main,SHOW=YES,,
STARTSCRIPT/
COMMENT/OPER,NO,variable is now
,V2

********

If I highlight and run the above block, nothing appears to happen. For instance, I set the variable to 99, run the block, and it comes back saying that the variable is 99.

If I just run the basic code, I get a msgbox saying that it is 99, then one saying "true" (the assignment was successful??). If I run the code again, it says that the value is 100, then 101, then 102. But nothing happens to the variable inside the program.

The example shows a line saying "ENDSCRIPT/", but no such line appears in my code window. I'm suspecting this is the problem here, but can find now way to insert that code in the program.

Any thoughts? I forgot how fun BASIC was, with no debugger, tools, etc.

TIA, tweaks