Wishlist for PureBasic v4.xx - Overview

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

@va!n

Code: Select all

OpenScreen(lWidth, lHeight, lDepth, cTitle$, [#Flags]) ;#PB_Windowed
no no no, i like the way due OpenWindowedScreen() because of various reasons.

and for the other stuff, an extra command would be nice, like SetFrameRate() for example SetAntiAliasing(), SetBufferingMode() etc. or something like that. if you want to change it during the game, for some reason (user request), then it would be way too ugly to close the screen and call again OpenScreen(lWidth, lHeight, lDepth, cTitle$, [#Flags]) because there would be no other way to do so.

Code: Select all

OpenScreen(..., #PB_AntiAliasing4x)
Delay(10000)
CloseScreen()
OpenScreen(..., #PB_AntiAliasing2x)

Code: Select all

OpenWindow() : OpenWindowedScreen()
SetAntiAliasing(4x)
Delay(10000)
SetAntiAliasing(2x)
its good to keep such commands seperated and so their possibilities wide open. :wink:

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@nco2k:
sorry.... it was a small mistake frome me... sure i dont want leave nor change the OpenWindowedScreen command! So the #PB_Windowed has been removed in my list and so an optional parameter for

OpenScreen(lWidth, lHeight, lDepth, cTitle$, [#Flags])

would be nice...! Ofcourse no modifying of OpenWindowedScreen! Was a small mistake by in the hurry.. sorry ;)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Re: Wishlist for PureBasic v4.0 - Overview

Post by Dr. Dri »

akee wrote:

Code: Select all

  var.b    ;  8 bits int
  var.w    ; 16 bits int
  var.l    ; 32 bits int
  var.q    ; 64 bits int
  
  var.ub   ;  8 bits unsigned int
  var.uw   ; 16 bits unsigned int
  var.ul   ; 32 bits unsigned int
  var.uq   ; 64 bits unsigned int
  
  var.f    ; 32 bits float
  var.d    ; 64 bits float 
  var.ld   ; 80 bit float (long double)   <--- for the huge scientific applications ;)
  
  var.s    ; ansi string  / character (maybe var.c !?)
  var.u    ; unicode string / character 
 
i agree, but asm 80 bit float is "tword"
var.t for 80 bit float ??? (a 'one letter' type like the others)

Dri
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

- Some standard basic Keywords like: Abs() for integers, best way two functions: Abs() & AbsF() ... Atan2(), Exp(), Pi() , Sgn() , MOD, NOT, XOR

has been added to the overview wish list..
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

Can't the normal Abs() function use integers too?
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Post by chris319 »

- comment blocks starting with /* and ending with */
Please make them nestable.
- Len() extended to support optional max length argument, and if not already so, make Len() internally limit to max PB string length if no max length is given by the programmer.
Does this float your boat?

Code: Select all

var.s32
... results in a 32-character string.
Will it be still a basic language ?
Why should it start now? :wink:
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Post by chris319 »

Here are some suggestions I posted to another BASIC board, all of them standards-compliant. Take your pick.
Here are some ideas for math functions. They are excerpted from the ANSI/ISO standard for BASIC (yes, there is a standard for BASIC).

CEIL(X) The smallest integer not less than X.
---------------------------------------------------------
Here is a line of code where I could have used CEIL:

bytespersample = samplebits / 8 + ((samplebits / 8) - int(samplebits / 8))

could have been written as

bytespersample = CEIL(samplebits / 8)
---------------------------------------------------------

IP(X) The integer part of X, i.e. SGN(x) * INT(ABS(X)).

FP(X) The fractional part of X, i.e., X - IP(X).

LOG10(X) The common logarithm of X; X shall be greater than zero.

LOG2(X) The base 2 logarithm of X; X shall be greater than zero.

MOD(X,Y) X modulo Y, i.e., X-Y*INT(X/Y). Y shall not equal zero.

PI The constant 3.14159...

ROUND(X,N) The value of X rounded to N decimal digits to the right of the decimal point (or -N digits to the left if N < 0); i.e., INT(X*10^N+.5)/10^N.

SGN(X) The sign of x: -1 if X < 0, 0 if X = 0, and +1 if X > 0.

TRUNCATE(X,N) The value of X truncated to N decimal digits to the right of the decimal point (or -N digits to the left if N < 0); i.e., IP(X*10^N)/10^N.

Note: IP() is not the same as INT(). Here is the definition of INT(X):

"The largest integer not greater than X; e.g., INT(1.3) = 1 and INT(-1.3) = -2." IP(-1.3) would return 1.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Chris, some of your requested things are already implemented, just read help and use PB :)

I see something is forgotten:
Replace Pow() by ^ operand.
^ operand is tipical in all basics
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

What "standard"? You have to remember that Purebasic have separated from the BASIC language quite a few versions ago :)
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Post by chris319 »

Chris, some of your requested things are already implemented, just read help and use PB
Right. I said that message was posted to another board (Liberty Basic) and to take your pick.
I see something is forgotten: Replace Pow() by ^ operand. ^ operand is tipical in all basics
It gets my vote. I could come up with a long list of ways I wish PB were more like ANSI Basic but I'm not about to start a campaign to reform PureBasic. It is what it is.
What "standard"? You have to remember that Purebasic have separated from the BASIC language quite a few versions ago
There IS an ANSI/ISO standard for BASIC, as well as for C, Pascal and several other languages. Standards are useful when it comes to portability. Once you've ported several programs from one idiosyncratic BASIC dialect to another, you'll come to appreciate the concept of portability. :wink:
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Code: Select all

test = NewList.l

AddElement(test, 55)

Dim a(50)
a(1) = NewList.l

Code: Select all

Try - Catch
Is closer to the line which causes an error than OnError lib or at least make OnError lib cross plattform.
I would like to see (I know that's not for everybody) that arrays start with 0 and go to max-1. So 'Dim a(4)' is from 0 to 3. Easier to convert code, standard and 'Dim a(0)' would really clean up the array.

greetz
Remi
Athlon64 3700+, 1024MB Ram, Radeon X1600
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

chris319 wrote:
What "standard"? You have to remember that Purebasic have separated from the BASIC language quite a few versions ago
There IS an ANSI/ISO standard for BASIC, as well as for C, Pascal and several other languages. Standards are useful when it comes to portability. Once you've ported several programs from one idiosyncratic BASIC dialect to another, you'll come to appreciate the concept of portability. :wink:
I am actually doing that between Visual Basic, iBasic, and Pure Basic. I wouldnt call any of them idiosyncratic ... but whatever ;) For BASIC langauges, I agree. But I would hardly call Pure Basic of the BASIC area. :)
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

And don't forget a inbuilt script engine... :)
I like logic, hence I dislike humans but love computers.
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

hopefully thats a joke :D
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Nik wrote:hopefully thats a joke :D
No I mean it, and I know it's suggested before.
It would be a very cool feature, but it can wait.
I like logic, hence I dislike humans but love computers.
Post Reply