几何尺寸与公差论坛

 找回密码
 注册
查看: 2946|回复: 1

【转帖】No ENDSCRIPT?

[复制链接]
发表于 2007-11-26 11:28:37 | 显示全部楼层 |阅读模式
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("CDLRN.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
 楼主| 发表于 2007-11-26 11:28:54 | 显示全部楼层

回复: 【转帖】No ENDSCRIPT?

Finally called the help desk, and I hadn't marked the script! It ran the comments OK, but not the script. Once I marked it, the /ENDSCRIPT line came up by itself.
tweaks
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 00:50 , Processed in 0.035628 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表