Automatic set ERR for error

New to FreeBASIC? Post your questions here.
MrSwiss
Posts: 3599
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Automatic set ERR for error

Postby MrSwiss » Jul 23, 2020 1:07

There seems to be a handling error with the obtained ERR ...
It must always be stored (Long) before a Print (statement) otherwise,
the ERR of Print itself, is printed out.

See examples in documentation ...
...
Dim As Long en = ERR
Print "ERROR #"; Str(en)
...
jj2007
Posts: 1688
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Automatic set ERR for error

Postby jj2007 » Jul 23, 2020 1:32

Good to know, thanks, but it doesn't change anything: Input does not produce errors.

Code: Select all

  INPUT "Type number"; number
  err_=Err()
  print "Err 1=";err_

Code: Select all

Type number? 1e50
Err 1= 0
Overflow, valid range is [+-] 1.401298e-045 ... 3.402823e+038 - your number is 1.#INF
Type number? 1e-50
Err 1= 0
Err 2= 0
Err 3= 0
Your SINGLE number is  0

Return to “Beginners”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests