getNewUpperCaseString
Short summary
this methods copy a string and returns the start address of new string, all small letters are capitalized in the new string.
:return: start address of a string.
If createNewUpperCaseString is TRUE then it's a new string
- Return type:
POINTER TO BYTE
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| stringAddress | POINTER TO BYTE | start address of the string to copy and capitalize | input |
| stringLength | UDINT | length of the string stringAddress | input |
| createNewUpperCaseString | BOOL | TRUE means meake a copy and capitalize it, FALSEmeans return juststringAddress`` and do nothing else | input |
| sbcsType | Tc2_Utilities.E_SBCSType | used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE | input |
Code
Declaration
METHOD PROTECTED getNewUpperCaseString :POINTER TO BYTE;
VAR_INPUT
(* start address of the string to copy and capitalize *)
stringAddress :POINTER TO BYTE;
(* length of the string ``stringAddress`` *)
stringLength :UDINT;
(*
``TRUE means meake a copy and capitalize it,
``FALSE`` means return just ``stringAddress``
and do nothing else
*)
createNewUpperCaseString :BOOL;
(* 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
IF (createNewUpperCaseString) THEN
getNewUpperCaseString := THIS^.getStringCopy(stringAddress, stringLength);
THIS^.upperCase(getNewUpperCaseString, stringLength, sbcsType := sbcsType);
ELSE
getNewUpperCaseString := stringAddress;
END_IF