hexagon logo

Assigning Integer value from a script

Here's some low hanging fruit for the right person Wink

I am trying to assign an value to an Integer type variable in PCDMIS program, from within a PCDMIS Basic script.

In the .PGM I have:

ASSIGN/MY_INT=INT(1)


Then, in the Basic script I am trying:

Dim App As Object
Set App = CreateObject("PCDLRN.Application")

Dim Part As Object
Set Part = App.ActivePartProgram

Dim SNVar As Object
Set SNVar = Part.GetVariableValue("SERNUMBER")

Dim PPVar As Object
Set PPVar = Part.GetVariableValue("MY_INT")



MsgBox PPVar.StringValue '[B]HERE GETTING A BLANK MSBOX[/B]

. . .

Dim kSUBRPP125 As Integer
kSUBRPP125 = 0

PPVar.StringValue = kSUBRPP125
MsgBox PPVar.StringValue 'HERE MSDBOX IS OK

Part.SetVariableValue "MY_INT", PPVar

​​

And finally back in .PGM I am casing out the new value of MY_INT that is supposed to be assigned in the above script, and the case doesn't execute:

SELECT/MY_INT
CASE/0
CS3 =CALLSUB/SUBR_125MM,C:\Users\Public\Documents\Hexagon\PC-DMIS\2021.2\Subroutines\Iprogname.PRG :,
END_CASE/
END_SELECT/​
​


I have other script code that successfully assigns string variable value. What am I doing wrong for integer variable setting?

Thx, z
Parents Reply Children
No Data