News:

  • October 14, 2025, 11:25:37 AM

Login with username, password and session length

Author Topic: STRINSERT - Argument out of Range (ST132)  (Read 4199 times)

sgsims

  • Hero Member
  • *****
  • Posts: 127
STRINSERT - Argument out of Range (ST132)
« on: August 30, 2016, 10:54:57 AM »
I am using the STRINSERT Inst to append an ASCII Control character to the end of a String in SS0.  Since the length of the string in SS0 will vary I thought I could specify an Offset value of 50 which is longer than the longest string SS0, (34) ASCII characters,  would see but still leave room for the appended Control character in the string.  When I execute the STRINSERT inst the control character is appended how I expected/hoped but I receive a ST132 Warning.

Should I worry about that warning and//or is there a better way of adding a control character to the end of an ASCII string.


plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: STRINSERT - Argument out of Range (ST132)
« Reply #1 on: August 30, 2016, 11:35:46 AM »
STRPRINT with the "append to string" checked.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

sgsims

  • Hero Member
  • *****
  • Posts: 127
Re: STRINSERT - Argument out of Range (ST132)
« Reply #2 on: August 30, 2016, 11:47:44 AM »
Works like a charm!  Thanks PLCnut...Guess I have to get my "String" on with all these string instructions:)

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: STRINSERT - Argument out of Range (ST132)
« Reply #3 on: August 30, 2016, 11:52:26 AM »
You're welcome. STRINSERT will also work if you set the index to String.length+1
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

sgsims

  • Hero Member
  • *****
  • Posts: 127
Re: STRINSERT - Argument out of Range (ST132)
« Reply #4 on: August 30, 2016, 11:57:23 AM »
Very cool also

sgsims

  • Hero Member
  • *****
  • Posts: 127
Re: STRINSERT - Argument out of Range (ST132)
« Reply #5 on: August 30, 2016, 01:02:11 PM »
Just curious the ss0.length + 1 isn't accepted into the "Starting at Offset" field.  Although it looks like all I need is the ss0.length in that field to get the control character appended on the end.

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: STRINSERT - Argument out of Range (ST132)
« Reply #6 on: August 30, 2016, 01:20:54 PM »
You would have to use a MATH for the SS0.length+1
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3761
    • Host Engineering
Re: STRINSERT - Argument out of Range (ST132)
« Reply #7 on: August 30, 2016, 04:15:53 PM »
Just curious the ss0.length + 1 isn't accepted into the "Starting at Offset" field.  Although it looks like all I need is the ss0.length in that field to get the control character appended on the end.

As with nearly all things Do-more, the block IDs and string character offset/index positions are 0-based, not 1 based.

Hence, the first character of SS0 is at index 0, not 1.  So the "Starting at Offset" parameter of SS0.Length is definitely how you would "append".