Page 1 of 1

Two odd omissions...

Posted: Mon Apr 25, 2005 4:20 am
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

Posted: Mon Apr 25, 2005 8:03 am
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

Posted: Thu Apr 28, 2005 2:21 am
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

Posted: Thu Apr 28, 2005 2:28 am
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.

Posted: Thu Apr 28, 2005 2:52 am
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