{++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ function to convert a string of maximum length = 255 to all upper case letters, and return the converted string. Corresponds to the BASIC command UCASE$. Requires pascal/z's external function, length. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++} FUNCTION UCASE(X:MSTRING): DSTRING; CONST OFFSET = 32; { Offset from 'A' to 'a' } VAR ch : char; I, LEN : 0..255; temp : DSTRING; BEGIN LEN:=LENGTH(X); { start by setting length of local string to length of string } { to be converted to uppercase. } setlength(temp,len); IF ( LEN=0 ) THEN {EXIT} ELSE BEGIN FOR I:=1 TO LEN DO BEGIN ch := X[i]; { if char is lower case then make uppercase } IF ( 'a'<=ch ) and ( ch<='z' ) then temp[i] := chr( ord(ch) - offset ) else { store as is } temp[i] := ch; END{FOR}; END{ELSE}; UCASE := temp; END;