I can't find my error in this...

BlitzMax Forums/BlitzMax Beginners Area/I can't find my error in this...

Ryan Burnside(Posted 2006) [#1]
Hmm maybe somebody can find my problem with this code. When it rry to run it it says it was expecting ")" but encountered end of the line.

Why doesn't this compiler tell you where the error is?

here is my code:

Graphics 640,480,0
Include "Interface.bmx"
' make some drawing commands

' draw rect unfilled
Function draw_rect_hollow#(x1#,y1#,width#,height#)
DrawLine x1,y1,x1+width-1,y1
DrawLine x1,y1,x1,y1+height-1
DrawLine x1+width-1,y1,x1+width-1,y1+height-1
DrawLine x1,y1+height-1,x1+width-1,y1+height-1
EndFunction

' draw circle unfilled
Function draw_ellipse_hollow#(x1#,y1#,width#,height#,segments:Int)

Local center_x#=x1+(width/2)
Local center_y#=y1+(height/2
Local x_radius#=(width-1/2)
Local y_radius#=(height-1/2)
Local angle#=360/segments
For i=0 To segments Step 1
DrawLine center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius,center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius
Next
EndFunction

' draw lines from center
Function draw_ellipse_lines#(x1#,y1#,width#,height#,segments:Int)

Local center_x#=x1+(width/2)
Local center_y#=y1+(height/2)
Local x_radius#=(width-1/2)
Local y_radius#=(height-1/2)
Local angle#=360/segments
For i=0 To segments Step 1
DrawLine center_x+Sin(i*angle)*x_radius,center_y-Cos(i*angle)*y_radius,center_x,center_y
Next
EndFunction


While Not KeyDown(Key_Escape) ' make sure the user hasn't quit

' draw step
' draw background
SetColor 250,250,244
DrawRect 0,0,640,480

' draw the crosshairs

SetLineWidth 3
SetColor 235,200,134
DrawLine MouseX(),0,MouseX(),480
DrawLine 0,MouseY(),640,MouseY()

draw_ellipse_hollow(0,0,640,480,36)


'the font please
SetScale 3,3
DrawText "SCORE: ",0,0
SetScale 1,1
Flip
Cls

Wend


Floyd(Posted 2006) [#2]
Missing ) in

Local center_y#=y1+(height/2


Chris C(Posted 2006) [#3]
hold down shift key press up or down cursor key, that should show you where the cursor is (it does move to the error line, its just hard to see!)


Ryan Burnside(Posted 2006) [#4]
Thank you for the help! I thought there was no error marking system. Thanks a bunch!


Grey Alien(Posted 2006) [#5]
yeah it needs to highlight the line or have a more obvios cursor really.


Chris C(Posted 2006) [#6]
yeah ya not kidding! simple things that often get missed and make all the difference...