Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Pbasic 2.5 syntax (http://www.chiefdelphi.com/forums/showthread.php?t=17714)

Rickertsen2 10-02-2003 20:32

Pbasic 2.5 syntax
 
does anybody know where i can find a pbasic 2.5 language reference. I can't find it on the parallax website! help!

FotoPlasma 10-02-2003 20:51

http://www.chiefdelphi.com/forums/pa...le&paperid=165

rust710 10-02-2003 20:54

I don't think a full 2.5 code referance exsists. The only thing aviable is a PDF file included in the beta version that has the new syntax features. It should C:\Program Files\Parallax Inc\Stamp Editor v2.0 Beta 1\PBASIC Editor 2.0 Beta1.pdf. There is also a short cut in Start Menu->Programs->Parallax Inc->Stamp Editor 2.0 Beta 1->PBASIC Editor 2.0 Beta1.pdf.

Hope that helps.

<edit> Guess I was wrong. Oh well.</edit>

Rickertsen2 10-02-2003 21:50

Does anybody know anything about the new scratchpad syntax. could somebody please explain it to me.

rbayer 10-02-2003 22:22

Quote:

Originally posted by Rickertsen2
Does anybody know anything about the new scratchpad syntax. could somebody please explain it to me.
It's the same as the old stuff. If you aren't familiar with that, check out the Stamp manual from Parallax's website. You should look for the PUT and GET commands.

Rickertsen2 12-02-2003 20:36

sorry this is my first time programming Pbasic. im mainly used to PHP and C++

Raven_Writer 14-02-2003 22:57

Wasn't there supposed to be syntax highlight? I looked through everything, but nothing for highlighting. I also need a little bit of help. I shouldn't be asking this since I've done a comparision between the syntax, but how is switch used?

rbayer 14-02-2003 23:35

Quote:

Originally posted by Raven_Writer
Wasn't there supposed to be syntax highlight? I looked through everything, but nothing for highlighting. I also need a little bit of help. I shouldn't be asking this since I've done a comparision between the syntax, but how is switch used?
Parallax has said from the beginning that the alpha/beta versions won't have syntax highlighting but the final version will.

There is no "switch" command. There is a SELECT...CASE...ENDSELECT structure, which does the same thing. Ie:

SELECT counter
CASE 0 TO 100
'do stuff
CASE 101 TO 200
'do other stuff
CASE 201 TO 255
'do even more other stuff
CASE ELSE
'stuff to do if none of the previous cases match
ENDSELECT

There's other things you can put after CASE also (such as a single number or an operator and a number (ie >5)), but the above code is the basics.

--Rob

Raven_Writer 14-02-2003 23:37

Quote:

Originally posted by rbayer
Parallax has said from the beginning that the alpha/beta versions won't have syntax highlighting but the final version will.

There is no "switch" command. There is a SELECT...CASE...ENDSELECT structure, which does the same thing. Ie:

SELECT counter
CASE 0 TO 100
'do stuff
CASE 101 TO 200
'do other stuff
CASE 201 TO 255
'do even more other stuff
CASE ELSE
'stuff to do if none of the previous cases match
ENDSELECT

There's other things you can put after CASE also (such as a single number or an operator and a number (ie >5)), but the above code is the basics.

--Rob

D'oh...all well, sorry about that. I thought I mixed it up. Can you do "CASE > 4" or just "CASE pw_12 > 4"?

rbayer 14-02-2003 23:44

Quote:

Originally posted by Raven_Writer
D'oh...all well, sorry about that. I thought I mixed it up. Can you do "CASE > 4" or just "CASE pw_12 > 4"?
The first one is legal (CASE >4). The second is not legal syntax. Here's a good way to thing of the operators: imagine taking the SELECT variable/expression (from SELECT expr) and putting it immediately in front of the thing after CASE. ie
SELECT p1_y
CASE <127
...
can be thought of as an if with predicate p1_y<127.

Raven_Writer 15-02-2003 08:56

So, SELECT / CASE is just like a easier IF/THEN statement in a way....nifty.


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

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