[fpc-pascal]runtime 201 with swapword function
Nikolay Nikolov
nickysn1983 at netscape.net
Fri Jul 25 16:31:10 CEST 2003
prologic at daisy.ods.org wrote:
>>>Why does the following result in a runtime error ?
>>>
>>>program example;
>>>
>>>const
>>>THE_PORT = 9999;
>>>
>>>function swapWord(w: Word): Word;
>>>begin
>>>swapWord := (w SHL 8) OR (w SHR 8);
>>>end;
>>>
>How can I correct this ?
>This bit of code was taken directly from server.pp in one of the old
>2002 mailing threads...
>
swapWord := ((w AND $FF) SHL 8) OR (w SHR 8);
More information about the fpc-pascal
mailing list