Go to Post Step 1: Get a blue banner. Step 2: Wave it everywhere until your School Board acknowledges your existence. We haven't gotten to Step 1 yet, unfortunately. - Chris is me [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 06-11-2001, 14:45
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Quote:
Originally posted by Joe Johnson
As to nesting if-elseif-else structures, please try to make this work. There are many situations where this is needed and it would be a bother to be able to us the new structures in one place but not in another. Isn't this a sort of natural recursion application?
You're right. This is a natural for recursion -- and that's what I had in mind. I think I should be able to do it without too much trouble, but you never know for sure until you get in there an get your fingernails dirty.



Quote:
To me, one of the biggest issues is generating goto labels that are easy enough to follow that folks that edit the resulting code directly see something that is editible.

How about this format $IF $IFLABEL (optional) $ELSEIF $ELSE $ENDIF

My thoughts would be that if you provided a label, then the label would be used as a basename for the various goto labels in Pbasic, if not, you get what you get.
I like your idea of allowing the user to provide labels, but $IFLABEL just doesn't have "sex appeal" for me. How about if I just take a look at the next non-blank, non-comment line, and if it's a label, I will use it instead of generating a label? Something like:
Code:
'{$IF condition 1}
Label1:
  statement block 1
'{$ELSEIF condition 2}
Label2:
  statement block 2

...

'{$ELSE}
LabelN:
  statement block n
'{$ENDIF}
EndIfLabel:
Quote:
As to what I mean by a common subroutine, I don't mean jumping to a new program slot and jumping back -- the way Pbasic handles jumps would add a lot of bother and overhead to any such systems. What I do mean is something like the header file, where I could define a subroutine one time and the pre-processor would add the code to the appropriate files for the approriate programming slots.
It sounds like the include file concept satisfies this requirement. Nicht Wahr?



Quote:
An input subroutine is a good example. I often end up calling the input subroutine from at least 2 programming slots and sometimes from 3. If I change the variables that the master CPU sends me (perhaps I want delta_t rather that packet_num), I need to change the subrountine in all 3 places or else I get the dreaded "PBasic Error LED of Death" to light up on the Operator Interface and I am dead in the water.
When you say "If I change the variables that the master CPU sends me", you don't mean that you have figured out a way to read different data at different times during a match, do you? That might be a nice feature, but the only way I can envision it being done is with a robot controller restart.



Quote:
Finally, what about text editing? How do you make your master file that the pre-processor processes? Has anybody made the leap to CodeWright? It is a very good program for C coding and other serious coding projects. One nice thing about CodeWrightt is that it knows the various keywords of the language you are using. It can be set up to show Constants in one color, variables in another, keywords in yet anther, etc. Has anybody taught CodeWright the Pbasic language? Do tell.
I've never used CodeWright, but it does sound nifty. I use the StampW editor. Typically, I start out everything at the preprocessor's GUI. I launch StampW from there. After I have finished editing, I exit back to the preprocessor GUI, and have it preprocess the project. After the project has been preprocessed, it gives you the option of launching the editor so you can download the program or continue editing it.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me

Last edited by Greg Ross : 06-11-2001 at 14:50.
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
PBASIC ARCTAN function Greg Ross Programming 14 11-05-2003 12:28
Obscure PBASIC for RoboEmu rbayer Programming 1 28-03-2003 23:57
PBasic 2.5 vs. 2.0 Anthony Kesich Programming 6 09-02-2003 22:06
emulationFIRST (aka PBasic emulator) Matt Leese Programming 5 30-06-2002 12:06
PBASIC Loop Speed? archiver 2001 3 23-06-2002 23:46


All times are GMT -5. The time now is 11:07.

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