Author Topic: Issue with version 0.2.1  (Read 226 times)

0 Members and 1 Guest are viewing this topic.

Arnold

  • Hero Member
  • *****
  • Posts: 882
Issue with version 0.2.1
« on: June 26, 2019, 02:43:22 PM »
Hi Charles,

print val("+15") ", " val("-12") will output: 0, -12. Should this not be 15 ?

John

  • Hero Member
  • *****
  • Posts: 3609
Re: Issue with version 0.2.1
« Reply #1 on: June 26, 2019, 05:10:08 PM »
Aren't positive numbers assumed? I rarely see a + to indicate a positive number.

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4222
    • Oxygen Basic
Re: Issue with version 0.2.1
« Reply #2 on: June 26, 2019, 07:48:40 PM »
I'll update the RTLs (ascii_to_float) so that '+' is ignored at the start of a number string.

It will be treated like leading spaces:

Code: [Select]
  'SKIP LEADING WHITE SPACE ETC
  '
  (
    mov al,[rcx]
    cmp al,0
    jz numnok 'end of string (error)
    (
     cmp al,43 'ignore '+'
     jnz exit
     mov al,32
    )
    cmp al,32
    jg exit 'start of word
    inc rcx
    repeat
  )