Skip to main content

lengthIsBetween

Short summary

This assertion method checks if the current string stringToCheck is length is equal or grater than minLength and equal or less than maxLength

Attention: All strings are handled as null terminated word streams. For UTF-16 is end of the string 16#00_00

Parameters

NameTypeCommentKind
stringToCheckPOINTER TO WORDcurrent string to checkinput
minLengthUDINTlower limit of the string lengthinput
maxLengthUDINTupper limit of the string lengthinput
stringLengthUnitUnicodeStringLengthUnitstring length units of measurementinput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

METHOD lengthIsBetween
VAR_INPUT
(* current string to check *)
stringToCheck :POINTER TO WORD;
(* lower limit of the string length *)
minLength :UDINT;
(* upper limit of the string length *)
maxLength :UDINT;
(* string length units of measurement *)
stringLengthUnit :UnicodeStringLengthUnit;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR