Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
FFMan
Posts: 502 Joined: 09 January 2010, 12:52 PM
Post
by FFMan » 04 April 2010, 7:47 AM
this code seems to generate a compiler issue :-
Code: Select all
Sub Main()
Dim a As Single
debug.print "cor on "+fmt(a/100.0,4)
End Sub
forget how to put the code tags in - sorry
dkinzer
Site Admin
Posts: 3120 Joined: 03 September 2005, 13:53 PM
Location: Portland, OR
Post
by dkinzer » 04 April 2010, 8:30 AM
FFMan wrote: this code seems to generate a compiler issue
The compiler doesn't handle this case correctly. My first thought is that it should be flagged as an error.
In any event, either of the two forms below work correctly with the first being more efficient.
Code: Select all
Debug.Print "cor on "; Fmt(a / 100.0, 4)
Debug.Print "cor on " & Fmt(a / 100.0, 4)
- Don Kinzer
FFMan
Posts: 502 Joined: 09 January 2010, 12:52 PM
Post
by FFMan » 04 April 2010, 8:56 AM
thanks don - i raised it only because i thought it should be handled differently
i have corrected the code as you suggest and all is well.