BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

StrToHex coercion

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Magnus Hald
Guest





PostPosted: Fri Feb 13, 2004 9:45 am    Post subject: StrToHex coercion Reply with 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
Jaap
Guest





PostPosted: Fri Feb 13, 2004 11:21 am    Post subject: Re: StrToHex coercion Reply with quote



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





PostPosted: Fri Feb 13, 2004 9:33 pm    Post subject: Re: StrToHex coercion Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.