Skip to main content

upperCase

Short summary

This method converts the lowercase letters in an 8 bit windows-1252 or windows-1251 string to uppercase letters.

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

Parameters

NameTypeCommentKind
stringAddressPOINTER TO BYTEstring to ucaseinput
stringLengthUDINTlength of the stringinput
sbcsTypeTc2_Utilities.E_SBCSTypeused Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLEinput

Code

Declaration

METHOD PROTECTED upperCase
VAR_INPUT
(* string to ucase *)
stringAddress :POINTER TO BYTE;
(* length of the string *)
stringLength :UDINT;
(* used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE *)
sbcsType :Tc2_Utilities.E_SBCSType := Tc2_Utilities.E_SBCSType.eSBCS_WesternEuropean;
END_VAR

Implementation

RETURN (stringAddress = 0);

CASE sbcsType OF
Tc2_Utilities.E_SBCSType.eSBCS_WesternEuropean:
upperCase1252(stringAddress, stringLength);

Tc2_Utilities.E_SBCSType.eSBCS_CentralEuropean:
upperCase1251(stringAddress, stringLength);
ELSE
; // do nothing
END_CASE