View Single Post
  #10   Spotlight this post!  
Unread 18-02-2003, 20:48
Scooter's Avatar
Scooter Scooter is offline
Galactic Doughnut!!
#0418 (Purple Haze)
Team Role: Programmer
 
Join Date: Feb 2003
Location: Austin, Texas
Posts: 117
Scooter will become famous soon enoughScooter will become famous soon enough
Send a message via AIM to Scooter
Here...Lemme put into comments what need to be fixed:

'********************

counter var word
counter=0

IF auton mode = 1 THEN 'needs to be auton_mode
select counter

IF rc_sw1=1 THEN start_left: 'lose the colon...
IF rc_sw2=1 THEN start_right: 'lose the colon

'Starting on left side of field
start_left:
(left auto program here)
goto imdone:

'Starting on right side of field
start_right:
(right auto program here)
goto imdone:

ELSE 'Resume Human Control
imdone:

'**************************

Here is what it should look like corrected (with a few tweaks added for efficency):

'**************************

counter var word
counter=0

IF auton_mode = 1 THEN
goto auton_on
else
goto imdone
endif

auton_on:
select counter

IF rc_sw1=1 THEN start_left
IF rc_sw2=1 THEN start_right

'Starting on left side of field
start_left:
(left auto program here)
goto imdone

'Starting on right side of field
start_right:
(right auto program here)
goto imdone

'Resume Human Control
imdone:

'**********************

You could also just use 1 switch for the left-right selection. Have it if the switch is open, then it goes left, else it goes right. This way, you avoid the instance of having both acidetally closed or open. Here is what your code would look like:

'**********************

counter var word
counter=0

IF auton_mode = 1 THEN
goto auton_on
else
goto imdone
endif

auton_on:
select counter

IF rc_sw1=1 THEN
goto start_left
else
goto start_right
endif

'Starting on left side of field
start_left:
(left auto program here)
goto imdone

'Starting on right side of field
start_right:
(right auto program here)
goto imdone

'Resume Human Control
imdone:

'*********************

Hope this helps.

Bill B.
__________________
"Those who think that they know everything are especially annoying to those of us who do."

Last edited by Scooter : 18-02-2003 at 20:54.