Unexpected binary operator

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.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Unexpected binary operator

Post by FFMan »

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

Re: Unexpected binary operator

Post by dkinzer »

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 »

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.
Post Reply