hexagon logo

Reset to nominals

Here's one...

I got it from WILCOX
Parents
  • Here is how you may want the .bas

    Sub Main
      Dim MyApp As Object
      Set MyApp = CreateObject ("PCDLRN.Application")
      Dim MyPartProgram As Object
      Set MyPartProgram = MyApp.ActivePartProgram
      Dim MyVar As Object
      Set MyVar = MyPartProgram.GetVariableValue ("TIMETOMOVE")
      MSGBOX Myvar.LongValue
        If Not MyVar Is Nothing Then
          MyVar.LongValue = MyVar.LongValue + 1
          MyPartProgram.SetVariableValue "TIMETOMOVE", MyVar
          MsgBox "V1 is now: " & CStr(MyVar.LongValue)
        Else
          Msgbox "Could Not find variable"
        End If 
    End Sub
    


    I'm not sure if the CStr is needed but you could try it (I'd try it without it too, I'm thinking it is not neded). I also removed a declaration of I = Object, it was not being referenced after the declaration. Let me know how you make out.

    Craig
Reply
  • Here is how you may want the .bas

    Sub Main
      Dim MyApp As Object
      Set MyApp = CreateObject ("PCDLRN.Application")
      Dim MyPartProgram As Object
      Set MyPartProgram = MyApp.ActivePartProgram
      Dim MyVar As Object
      Set MyVar = MyPartProgram.GetVariableValue ("TIMETOMOVE")
      MSGBOX Myvar.LongValue
        If Not MyVar Is Nothing Then
          MyVar.LongValue = MyVar.LongValue + 1
          MyPartProgram.SetVariableValue "TIMETOMOVE", MyVar
          MsgBox "V1 is now: " & CStr(MyVar.LongValue)
        Else
          Msgbox "Could Not find variable"
        End If 
    End Sub
    


    I'm not sure if the CStr is needed but you could try it (I'd try it without it too, I'm thinking it is not neded). I also removed a declaration of I = Object, it was not being referenced after the declaration. Let me know how you make out.

    Craig
Children
No Data