Skip to main content

lengthIsExact

Short summary

This assertion method checks if the current string stringToCheck length is equal to expectedLength

Attention: All strings are handled as null-terminated byte streams

Parameters

NameTypeCommentKind
stringToCheckPOINTER TO BYTEcurrent string to checkinput
expectedLengthUDINTexpected length of stringToCheckinput
stringLengthUnitUnicodeStringLengthUnitstring length units of measurementinput
messageAssertMessagemessage if the assertion is falseinput

Code

Declaration

METHOD lengthIsExact
VAR_INPUT
(* current string to check *)
stringToCheck :POINTER TO BYTE;
(* expected length of ``stringToCheck`` *)
expectedLength :UDINT;
(* string length units of measurement *)
stringLengthUnit :UnicodeStringLengthUnit;
(* message if the assertion is false *)
message :AssertMessage;
END_VAR