I am looking to use a WORD data type to store a unicode character - I have chosen the WORD datatype as this is the underlying data type of the WSTRING.
Basically I would like to be able to say:
wTemp := "<";
I have found a way around this problem but it is very un-eloquent and goes like this:
wsTempString: WSTRING := "<";
wTempWord := wsTempString;
This has the desired effect of placing the hex value of < into wTempWord, but the readability of the program is awful, is there a way I can write the unicode character straight into the WORD variable.
I'm thinking of C in doing this:
temp = 'A';
Any help appreciated.
I don't know if a function for this already exists, but it is pretty easy to make:
FUNCTION WS_TO_W : WORD
WS : WSTRING(1);
pW : POINTER TO WORD;
pW := ADR(WS);
WS_TO_W := pW^;
Then call this from your application
wWord := WS_TO_W("<");
Log in to post a comment.