[fpc-pascal] WORD (2 bytes) to String conversion

Vincent Snijders vsnijders at vodafonevast.nl
Sat Oct 24 10:24:37 CEST 2009


Graeme Geldenhuys schreef:
> 2009/10/24 Vincent Snijders <vsnijders at vodafonevast.nl>:
>> But then you still cannot do:
>>
>> if header.id='HS' then
>>  // magic is correct.
>>
>> That is why I proposed a static array of char.
> 
> 
> No, but I can do this... which is sufficient.
> 
> var
>   s: string
> begin
>   s := hdr^.ID;
>   if S = "HS" then
>     ...
> 
> 

Not with fpc, I guess, otherwise I learned two new features:
* string constants that are surrounded with double quotes
* assignment to static array of byte to a string without conversion

What type is ID?

Vincent



More information about the fpc-pascal mailing list