Re: Phix - bytes_to_int

new topic     » goto parent     » topic index » view thread      » older message » newer message
lesterb said...

The last (unnecessary) byte is ignored by Eu3 but causes an exception in Phix as follows...

--Result with Eu3.1 
  22 
 
--Result with Phix 
  (warning: lineno of -1 for era of #0060CF5F) 
  fatal exception #80000003 at #0060CF5F 

Thanks, the next release will instead issue

C:\Program Files (x86)\Phix\builtins\machine.e:213 in function bytes_to_int() 
peek size must be 1|2|4|8 

and the manual (for bytes_to_int) has been clarified slightly:

This routine can be used for byte/word/dword/qword conversion, and is just a simple wrapper for peekNS(). 
An error occurs if s contains any non-atom elements, or the length is not one of 1, 2, 4, or 8 (unlike OpenEuphoria, which pads/trims it to length 4). 

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu