Page 1 of 1

Almost time for next update?

Posted: Wed Aug 30, 2006 4:59 am
by Amiga5k
In general, PB updates have come approx. every 3 months or so. Are we due for the next one soon?

Will it have:
- All official commands supported on all versions?
- 3D more fully integrated/supported?
- Floats accepted in For/Next loops?
- Even better Interface support (for OPTIONAL OOP programming)?
- Line continuation character?

I can hardly wait!

Russell

Posted: Wed Aug 30, 2006 5:30 am
by aaron
The Mac and Linux ports are underway.... that stuff will be finished up before any real feature additions are made.

Re: Almost time for next update?

Posted: Wed Aug 30, 2006 4:06 pm
by dell_jockey
Amiga5k wrote:Will it have:
- Floats accepted in For/Next loops?
.....
due to rounding errors with floats, this suggestion doesn't make sense. Now, if PB were to introduce BCD's, you would be on to something, but only marginally so...

Re: Almost time for next update?

Posted: Wed Aug 30, 2006 4:11 pm
by DarkDragon
dell_jockey wrote:
Amiga5k wrote:Will it have:
- Floats accepted in For/Next loops?
.....
due to rounding errors with floats, this suggestion doesn't make sense. Now, if PB were to introduce BCD's, you would be on to something, but only marginally so...
Normally you just code decimals with BCD, not floats, that's why it is called Binary Coded Decimals. You mean fixed comma floats.

Re: Almost time for next update?

Posted: Fri Sep 01, 2006 3:15 am
by Amiga5k
dell_jockey wrote:
Amiga5k wrote:Will it have:
- Floats accepted in For/Next loops?
.....
due to rounding errors with floats, this suggestion doesn't make sense. Now, if PB were to introduce BCD's, you would be on to something, but only marginally so...
Sorry, Dell_Jockey, but your answer doesn't make sense, since PB is the ONLY Basic dialect I know of that DOESN'T support floats as indexes in For/Next loops. Even very old Basics, such as the Commodore 64's 'V2' Basic allows you to 'step' by fractional amounts in For/Next loops. (Try it in a C64 emulator if you don't believe me).

Russell

Re: Almost time for next update?

Posted: Fri Sep 01, 2006 6:27 am
by PB
> Try it in a C64 emulator if you don't believe me

This has already been discussed in great length here:
http://www.purebasic.fr/english/viewtopic.php?t=19452

Posted: Fri Sep 01, 2006 7:34 pm
by va!n
@dell_jockey:
Even C64, BlitzBasic for example are supporting floats for steps ^^

Posted: Sun Sep 03, 2006 2:17 am
by Amiga5k
Not to continue to beat this dead horse, as they say, but, come to think of it, I don't think there are *any* languages, other than possibly assembler, that don't allow fractional steps in For/Next (or the closest equivilant {Yes, I know it can be done in other types of looping structures in PB}).

It's a minor annoyance, but still should have been added by now (But just about everything else exceeds expectations :D )

I have no doubt that it will be added in the near future. Right, Fred? ;)

Russell

Posted: Sun Sep 03, 2006 10:35 am
by Trond
Why on earth would you need floats for something like that? As late as yesterday I saw someone with problems because they used floats and a for loop. A small rounding error became larger as the loop looped.

Posted: Thu Sep 07, 2006 4:00 am
by Amiga5k
And yet somehow programmers have continued to use floats for various purposes, despite this "limitation"... ;)

Seriously, it should be up to me as to when and where I can use floats. If I know its quirks, I should be the one who decides whether or not to use them in a particular case. For example, obviously I know to not check for a specific value such as 3.2, since the float will most likely have a value of 3.19999982 or whatever. I would instead use somethng like "> 3.19" or "< 3.21" depending on how much precision I'm needing.

Hey, we've got Gosub/Return which is "obsolete", why not this?

Russell

Posted: Thu Sep 07, 2006 11:56 am
by Trond
Can you give an example where you have to use floats?

Posted: Thu Sep 07, 2006 12:18 pm
by Derek
How about in a fractal generator where both axis are fractional parts.

I know you would probably use x=0 to 640 and y=0 to 400 for the screen and use floats just as offsets into the small fractal but it's an example anyway.

Posted: Thu Sep 07, 2006 12:52 pm
by Trond
Derek wrote:I know you would probably use x=0 to 640 and y=0 to 400 for the screen and use floats just as offsets into the small fractal but it's an example anyway.
But you don't have to use floats.

Posted: Thu Sep 07, 2006 1:13 pm
by Dare
Amiga5k wrote:Seriously, it should be up to me as to when and where I can use floats.
I tend to agree.

Opinions on things like this (and other things, eg optional parameters to be anywhere in the argument list -v- just at the end :P ) should be switched - from the development team's personal preference to the coder's personal preference.

Then those who want to can, and those who don't want to don't have to.

We can even give a prize to people who code using the ideal (the "PureBasic recommended practices") ..

.. and look pityingly on people who use:

Code: Select all

Procedure myBadPractice(aVar.l, myVar.l = 0, myOtherVar.f)
  If myVar = 0
    Debug "He He, used an 'embedded' optional, didn't you?"
  EndIf
  For my.f = 1.0 to myOtherVar
    Debug "tut tut, but at least it can be done! " + StrF(my)
  Next
EndProcedure
:D

Posted: Thu Sep 07, 2006 9:49 pm
by Amiga5k
There are countless examples of where a float could be used in loops. (Infinite, in fact, since there are an infinite number of programming goals that one could be pursuing). It could be something as simple as:

Code: Select all

For i.f = 0 To 100 Step .2
  Print i
Next
The trick would be that a Step value would be required (unlike with Integers), since PB doesn't know what the next value should be: Is it .1 or .01 or .001 etc... With Ints, PB knows that 1 follows 0 and so on.

Anyway, as it's been said, there are other ways to do this without using For/Next:

Code: Select all

i.f = 0
Repeat
  Print i
  i + .2
Until i > 99.999
... but I should be the one to decide what kind of loop structure I want to use. The last line, "Until i > 99.999" allows me to determine how much accuracy is needed (I could use "Until i > 99.9" for less critical situations).

If Fred doesn't want to add it, that's fine; I have gone without it for this long - I'll live. But it would be nice to have it for those rare situations.

Russell