Two odd omissions...

Everything else that doesn't fall into one of the other PB categories.
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Two odd omissions...

Post by Amiga5k »

I was a little surprised that I can't do this:

Code: Select all

For a.f = 0 to 1 Step .1
  ; Do some stuff with floats
Next
(Can't use floats in a For/Next loop?)

Or this:

Code: Select all

If OpenConsole() = 0 : End
Is there no one-line If/Then (even though I know "Then" is not supported)?

Floats in For/Next would especially be helpful...

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
Tommeh
Enthusiast
Enthusiast
Posts: 149
Joined: Sun Aug 29, 2004 2:25 pm
Location: United Kingdom

Post by Tommeh »

First, no i don't think you can put floats into For loops,

But the second one,

Code: Select all

If OpenConsole() = 0 : End : Endif
You must always close the IF statement
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

First, no i don't think you can put floats into For loops,
Um, yeah, I know. That's why I posted it :wink:
Although Pure is the only BASIC I have used that doesn't support floats in For/Next loops. There are other ways to do it, of course, but just thought it was unusual that PB doesn't have it.
But the second one,

Code: Select all

Code: 
If OpenConsole() = 0 : End : Endif 
You must always close the IF statement.
Yeah. But, again, every other BASIC allows you to simply say

Code: Select all

If whatever Then DoThis.
..if it's on the one line. I would expect it to have to be closed if it is on multiple lines (an If/Then block).
They are minor, to be sure, but just would be nice to have.

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

PureBasic is kind of like the Not-BASIC.

To do most things you'll efventually need to hit the API, and the syntax is more of a cross of BASIC and C. Overall its pretty good, just a little weird to get used to. A bit unpolished as of yet.
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

Yeah, PB can be a bit 'odd' at times, but nothing really major. And really, some of the things it DOES support are not seen in many other Basics. I think a few things wil probably be seen in version 4.0:

- The 'Not' operator (either through 'Not' or through '!' or whatever)
- The above-mentioned floats in For/Next loops
- One line If statements
- line extensions (using "_" or ".." etc to extend to the next line)

<Fingers crossed>

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
Post Reply