Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84248members
353348posts

String to Long

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
DavidSkilbeck
Lt. Commander
Lt. Commander
0 Likes
1
620

String to Long

Hi Guy's,

I don't think there is. However, I may stand corrected.
Which would be a good thing in this case.

 

With Geo SCADA VB can you convert a string into a long?

CLng does not seem to exist.

Also, is there another way?

 

Thanks,


Accepted Solutions
AdamWoodland
Commander Commander
Commander
0 Likes
0
617

Re: String to Long

Assuming you're talking scripting on mimics, it is just normal VBScript (it is using the ActiveScript engine provided by Microsoft), the development team just add a few objects (like Server) for you to use.

 

CLng should work fine.

 

Option Explicit

Public Sub DoMaths

 MsgBox(CLng("1") + CLng("2"))

End Sub

 

The above code shows 3, whereas if it was treated as a string it would show 12 (and I would have better used & instead of + for a string concatenation to avoid ambiguity, but that's a different issue)

See Answer In Context

1 Reply 1
AdamWoodland
Commander Commander
Commander
0 Likes
0
618

Re: String to Long

Assuming you're talking scripting on mimics, it is just normal VBScript (it is using the ActiveScript engine provided by Microsoft), the development team just add a few objects (like Server) for you to use.

 

CLng should work fine.

 

Option Explicit

Public Sub DoMaths

 MsgBox(CLng("1") + CLng("2"))

End Sub

 

The above code shows 3, whereas if it was treated as a string it would show 12 (and I would have better used & instead of + for a string concatenation to avoid ambiguity, but that's a different issue)