Go to Post This isn't a golden ticket - it's a golden opportunity. It's up to you to earn it. - Jessica Boucher [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2-week FIRST summer program @ WPI ColleenShaver General Forum 20 31-05-2009 03:02
Fried program slots? Jeff Waegelin Programming 18 19-03-2003 18:08
Ahh! Program trick confusing! archiver 2001 9 24-06-2002 02:26
Credits for FIRST program. archiver 2000 6 24-06-2002 00:16
An invitation for HS Juniors archiver 2000 0 23-06-2002 22:51


All times are GMT -5. The time now is 08:55.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi