Go to Post With one post, Mr. Miller joins the top 0.7% of Chief Delphi, reputation-wise. I think the community supports him. - Taylor [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 28-03-2003, 22:54
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Obscure PBASIC for RoboEmu

Alright all you PBASIC Gods out there: here's a few stumpers for you! I'm in the middle of re-doing the expression evaluator (read: deleting and starting over) for RoboEmu 2.0 and need some help with a few of the more archaic, odd, and downright nutty things you can do with PBASIC.

Without further ado, here they are:

1. What do equalities actually evaluate to? I ask because things such as "if ((5>3)=3)=1<2 ..." are actually valid syntax. However, figuring out the value of this depends on what things like (5<3) actually evaluate to. Is it 1? Undefined? Variable based on the situation? Also, are these left-to-right or right-to-left?

2. What does the keyword AND/OR/XOR actually do? Similar to the above example, "if 3 AND 4 ..." is valid. I assume PBASIC will evaluate this to true as both 3 and 4 are non-zero, but can anyone confirm this?

3. How long can labels, variables, etc be? I believe it's 32 characters, but can anyone confirm/deny?

4. Not really a question, but more of a confirmation thing. Here's the order of operations I've come up with. Is this right?
top: AND, OR, XOR
next: =, <>, etc
next: ~, SIN, etc
last: +, -, etc

5. Anyone have any other obscure features you'd like to make sure RoboEmu supports?

Thanks in advance for all your help!

--Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #2   Spotlight this post!  
Unread 28-03-2003, 23:57
JasonStern JasonStern is offline
Mentor
FRC #1123 (AIM Robotics)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Arlington, VA
Posts: 65
JasonStern is on a distinguished road
1. it is step by step, left to right, unless you use parenthesis. as for inequalities, they eval to a 0 or a 1. atleast, thats how it works in C++ so im assuming it is the same for pbasic. therefore (255>200)>100 will return false as (225>200) becomes 1 and 1 >100 is not true.

2. same as above, it either evals to true (1) or false (0). if i'm remembering correctly, the only time a number is false is if it is 0, all other times it is true (ie, 1 is true, so is 2,3,4 -10,-12, etc..) and AND requires all to be true, while an or requires only one, or both to be true. an XOR is true if one and only input is true ( 1 xor 0 = 1, 0 xor1 =1, 1 xor 1 = 0, 0xor0=0)

Thats all I know, for now. hope this helps! Thanks for all the work you put into robo emu, we appreciate it!
__________________
Que será será

Last edited by JasonStern : 28-03-2003 at 23:59.
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
Need to learn PBASIC...Where Should I Go? IMDWalrus Programming 5 29-04-2003 16:43
PBasic 2.5 vs. 2.0 Anthony Kesich Programming 6 09-02-2003 22:06
RoboEmu 1.09 (supports PBASIC 2.5) rbayer Programming 22 21-01-2003 17:22
RoboEmu v.1a (another PBASIC emulator) rbayer Programming 0 07-07-2002 00:45


All times are GMT -5. The time now is 13:34.

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