Is there any kind of split string function in EasyLanguage?

snackly

Junior member
Messages
14
Likes
0
I'm dealing with a string that is comma or pipe ("|") delimited from an external DLL. I get this string back in Tradestation/EasyLanguage and I need to split it into an array of values.

Is there any built in function for this in EasyLanguage? Would it even be possible with whatever existing string functions are in the library?

Thanks for any feedback on this.
 
I'm dealing with a string that is comma or pipe ("|") delimited from an external DLL. I get this string back in Tradestation/EasyLanguage and I need to split it into an array of values.

Is there any built in function for this in EasyLanguage? Would it even be possible with whatever existing string functions are in the library?

Thanks for any feedback on this.

These string functions will extract data from specified positions:

MidStr(Str, Pos, Count)
LeftStr(Str, Count)
RightStr(Str, Count)

It's also useful to use this in cojunction with global variables.

For example this sets a GV with the name "My Order Number" to the value given. Both the name of the GV and the value can be the result of a calculation, so you can GV names specific for a symbol or a timeframe.

IntVRtn = GVSetNamedInt( “My Order Number”, 12345 ) ;

ErrorTest = GVSetNamedString( “String 1”, “Some text…” ) ;

You can retrieve and use these values using

MyInt = GVGetNamedInt( “An Int Var’s Name”, -999 ) ;

Twine = GVGetNamedString( “Rope”, “Error Message” ) ;

Note there are many more GV functions, but these are probably the 2 most useful ones to set and retrieve numeric or text values that can be used anywhere in your code and across different indicators and charts.

Charlton
 
Last edited:
Top