Go to Post Playing fields outdoors in the snow and the only field faults were when you ran out of gas!...ahh the old days - ExTexan [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 31-01-2003, 08:46
powercat powercat is offline
Registered User
no team
 
Join Date: Jan 2003
Location: Kansas
Posts: 14
powercat is an unknown quantity at this point
PBasic Select Problem

Greetings,
I have chosen to use the new
SELECT construct in PBasic. Here
is the code fragment:

'Dead Reckoning Code
Select stepnum
CASE 0 : gosub go_home
CASE 1 : gosub go_home2
CASE 2 : if rc_sw3 = UP & rc_sw4 = UP then
gosub go_left
else
gosub go_right
CASE 3 : gosub go_forward
CASE 4 : if rc_sw3 = UP & rc_sw4 = UP then
gosub go_left
else
gosub go_right
CASE 5 : gosub go_longforward
ENDSELECT

When I check syntax, it always highlights the stepnum variable and provide the following error:

Expected ':' or end-of-line
Error: 129-Expected ':' or end-of-line

What causes this error ? Searched and couldn't find anything.

Am running the 2.0 beta 1 editor. It acts like it doesn't understand the new language features.

thanks in advance.
  #2   Spotlight this post!  
Unread 31-01-2003, 09:06
Brian M. Brian M. is offline
CGA Team USA-Also On FRV Team 30
FRC #0500 (CGA Team USA)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2003
Location: GA
Posts: 20
Brian M. is on a distinguished road
I had that error once when I had forgot to define a variable.

Have you also checked to make sure that you have included the new PBASIC 2.5 definition at the top?

Code:
' {$PBASIC 2.5}
  #3   Spotlight this post!  
Unread 31-01-2003, 09:28
powercat powercat is offline
Registered User
no team
 
Join Date: Jan 2003
Location: Kansas
Posts: 14
powercat is an unknown quantity at this point
Put that in right below
{$STAMP BS2SX}

But It compains about my constant
definition:

ON con 1

Is ON now a predefined constant ?
Tried using the stamp editor help
to find this out but its useless.

Are the constants ON, OFF, TRUE,FALSE
UP,DOWN now predefined ?

thanks
  #4   Spotlight this post!  
Unread 31-01-2003, 10:36
Mike Soukup's Avatar
Mike Soukup Mike Soukup is offline
Software guy
FRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Schaumburg, IL
Posts: 797
Mike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond repute
Yes, most likely they're reserved. Instead pick a constant that has more meaning, such as ARM_UP, or LIFT_UP, etc.

You'll also get an error in your code because you didn't close your if conditions with an 'endif'
  #5   Spotlight this post!  
Unread 31-01-2003, 11:01
powercat powercat is offline
Registered User
no team
 
Join Date: Jan 2003
Location: Kansas
Posts: 14
powercat is an unknown quantity at this point
I already fixed the missing ENDIF
problem.

thanks for the heads up.
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
Ok one problem cantwell03 Programming 3 13-02-2003 07:28
RoboEmu 1.09 (supports PBASIC 2.5) rbayer Programming 22 21-01-2003 17:22
The problem with scouting... archiver 2001 10 23-06-2002 23:49
Major problem with chipphua motors aka Scott White Motors 18 19-03-2002 19:44
PBASIC problem punarhero Programming 7 16-02-2002 23:13


All times are GMT -5. The time now is 02:04.

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