|
Post by Ranger1800 on Jun 14, 2004 12:52:26 GMT -5
i get an reDIMMED variable error when i run this little mouse program:
dim x#, y#, char$ dim x1#, y1#, x2#, y2# dim lmb_down_once
ResizeText (80, 50) dim x, y, char$ <- the reDIMMED error is with char$
lmb_down_once = false while true glClear (GL_Depth_Buffer_Bit or Gl_Color_Buffer_Bit) glLoadIdentity () glTranslatef (-5, 5, -10) glPointSize (5) glPushMatrix () glBegin (Gl_Points) glColor3f (1, 1, 1): glVertex2f (x#, y#) glEnd () glPopMatrix () if not Mouse_Button (Mouse_LButton) then lmb_down_once = true x1# = x#: y1# = y# endif wend
while true if not Mouse_Button (Mouse_LButton) then locate x, y: print char$ endif x = Mouse_X () * TextCols () y = Mouse_Y () * TextRows () char$ = CharAt$ (x, y) locate x, y: print "X" wend if lmb_down_once then x2# = x#: y2# = y# glBegin (Gl_Lines) glVertex2f (x2#, y1#) glVertex2f (x2#, y2#) glEnd () glBegin (Gl_Lines) glVertex2f (x2#, y1#) glVertex2f (x2#, y2#) glEnd () glBegin (Gl_Lines) glVertex2f (x2#, y1#) glVertex2f (x2#, y2#) glEnd () glBegin (Gl_Lines) glVertex2f (x1#, y1#) glVertex2f (x1#, y2#) glEnd () endif x# = Mouse_X () * (WindowWidth () / 80.0) y# = Mouse_Y () * (WindowHeight () / 60.0)
SwapBuffers ()
|
|