 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Magnus Hald Guest
|
Posted: Fri Feb 13, 2004 9:45 am Post subject: StrToHex coercion |
|
|
My program holds 2 bytes in a ShortString ( e.g. FF ) which is actually
a Hex value that I want to store in a word-variable.
How do I cast it to fit in to a word type, or , more precisely,
copy my two bytes into the word wariable ?
Thanks for tips
Mags
|
|
| Back to top |
|
 |
Jaap Guest
|
Posted: Fri Feb 13, 2004 11:21 am Post subject: Re: StrToHex coercion |
|
|
In c0i6h5$169884$1 (AT) ID-218601 (DOT) news.uni-berlin.de,
Magnus Hald <magnushald (AT) yahoo (DOT) co.uk> typed:
:: My program holds 2 bytes in a ShortString ( e.g. FF ) which is
:: actually a Hex value that I want to store in a word-variable.
::
:: How do I cast it to fit in to a word type, or , more precisely,
:: copy my two bytes into the word wariable ?
::
:: Thanks for tips
:: Mags
StrToInt( '$' + 'FF');
jaap.
|
|
| Back to top |
|
 |
Jamie Guest
|
Posted: Fri Feb 13, 2004 9:33 pm Post subject: Re: StrToHex coercion |
|
|
insert or have the '$' infront of your HEX strings when passing it
to the StrToInt function.
MyWordVar := StrTroInt('$'+whatEverString);
Magnus Hald wrote:
| Quote: | My program holds 2 bytes in a ShortString ( e.g. FF ) which is actually
a Hex value that I want to store in a word-variable.
How do I cast it to fit in to a word type, or , more precisely,
copy my two bytes into the word wariable ?
Thanks for tips
Mags
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|