HSL Help: Using Functions

Hey everyone,

New to HSL and trying to write a simple HSL script that finds certain characters in a string. When trying to use basic functions like ‘GetLength()’, I keep getting errors about a ‘wrong member function’.

Is there a good example HSL code that I can look at that utilizes some of the string manipulator functions?

Thanks!

I happily second the inquiry.
I have so far been able to check the hsl-file of a method to find functions I am looking for. This is cumbersome, though.
To your question: are you aware of the string-library? I think it contains the function you are looking for.

As usual my reply might be late. None the less an answer might help someone else.
When you get the “wrong member function” when using GetLength() it is possible that your string isn’t actually a string. You can check what type a variable is with the GetType() function.
Below is what I implemented to please our LIMS developer

tempResult.ReadRecord(); //this performs the same action as drag and drop function File: Read;
dummy = StrGetLength(TPositionId); //this is due to the stupid restriction LIMS has that position needs to be anotated A01 and not A1
if(dummy < 3 && outputtype >= 6)
{
	dummy = StrLeft(TPositionId, 1);
   dummy2 = StrRight(TPositionId, 1);
   TPositionId = dummy + "0" + dummy2;
}
dummy = StrGetLength(SPositionId);
if(dummy < 3 && inputtype >= 6)
{
	dummy = StrLeft(SPositionId, 1);
   dummy2 = StrRight(SPositionId, 1);
   SPositionId = dummy + "0" + dummy2;
}
tempLog.WriteRecord(); // write a formatted resultlog-file