Wishlist for PureBasic v4.0

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Sylvia
New User
New User
Posts: 4
Joined: Thu Jan 01, 2004 8:25 pm
Location: Old Europe - Germany

Post by Sylvia »

My little wish: a Command like FreeID()

Result=FreeID() ;Result' contains the next free logical #ID

I manage me momentary with following routine:

Code: Select all

     Global FreeID$

Procedure.l FreeID(Nr)
     ; Gives the next free (1-65536) logical ID (for Files etc.) back
     ; Managed become the ID's in the GLOBAL 'FreeID$' (!Important!)
     ;
     ; Nr = 0       deliver the next available logical ID
     ; Nr<> 0       again freely the ID "Nr"
     ;
     ; Result<0     no free ID available
     ; Result>0     contains a free logical ID

     Protected Result

     Nr=Abs(Nr)
     Result=0

     If Nr=0
          ; still NOTHING distribute ?
          If Len(FreeID$)=0
               ; Each with "X" covered byte represents a distributed FreeID
               FreeID$="X"
               ProcedureReturn 1
          Else
               ; all ID's distribute ?
               If Len(FreeID$)=65536: ProcedureReturn -1: EndIf

               ; look for next free place
               Result=FindString(FreeID$,"O",1)
               If Result=0
                    ; no free place found ?; String expand
                    FreeID$+"X": Result=Len(FreeID$)
               Else
                    ; ID newly distribute
                    FreeID$=Left(FreeID$,Result-1)+"X"+Right(FreeID$,Len(FreeID$)-Result)
               EndIf

               ProcedureReturn Result
          EndIf
     Else
          If Nr>0 And Nr<=Len(FreeID$)
               ; release ID again
               FreeID$=Left(FreeID$,Nr-1)+"O"+Right(FreeID$,Len(FreeID$)-Nr)
          EndIf
     EndIf

EndProcedure
More efficience would be use of a Bit-Plane (personaly me: shit on it;
it's sufficiently memory here :))
Basic Pur = PureBasic
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

i think Fred is planning on introducing a new constant for dynamically giving you a free #ID used like this:

Code: Select all

StringGadget(#PB_Any, 0, 0, 100, 21, "Dynamic ID Number")
--Kale

Image
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

My wishes:

1) Make it possible to create a hook for each window to separate proc.
2) BSTR support
3) Null terminated strings (+pointers)
4) Option Explicit (Like VB)
5) Compile to dll "filename"
6) IDE, simple paste workaround which results in plain text pasting from help for example (easy to do).
7) Afaik, the debug is turned on when IDE is loaded, use last setting.
8) Help is fine but improve it with better examples and enumerated constant list or so.
9) Complexer examples
10) Fileversion info in PureBasic.exe
11) Native resource support for created exe / dll, also with functions.
12) I'm not a fan using the id's for each part in pb, like the openlibrary( #id) stuff.
Would like to see more support using the native handles, but not as workaround.
It's less dynamic thgis way, imagne i include a module from other users having #1 as fixed value...
I know, windows control id's is a contradiction since these behave the same way as pb does :)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Of course don't forget to elaborate PBHelp a little bit more.
I can't see there already existing functions like EventwParam(), EventlParam(), etc.
:arrow: At least if there is not wished for PB to have some secrets, like best Konami games, Microsoft games (for example MSOffice, etc.), etc. :wink:

AL
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

IIRC EventwParam(), EventlParam() are deprieciated and shouldnt be used!
--Kale

Image
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

Please, give every gadget an extra class, so when you're trying to colorize the background of one gadget, not all other gadgets of the same type will be colored too.
It could be a command like ChangeGadgetClasses() to dynamically create a new class, rather than doing it everytime, which would be pointless too.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

unique but reusable id's in pb:

Code: Select all

  Global x_nr_n.l
  x_nr_n = 100                            ; arbitrary value, first unique number given out 
  NewList x_nr_list.l()                   ; see x_nr() for more details

Procedure.l x_nr()
  Global x_nr.l, x_nr_n.l
  ;
  ; *** generates a new unique number
  ;
  ; in:      none
  ; retval:  unused unique number
  ;
  ; pure sometimes uses 'numbers' to identify elements instead of windows handles
  ; these numbers are arbitrary and fully defined by the user, this can cause trouble
  ; when using multiple libraries or code from different people as they might be reusing
  ; these unique numbers, for this purpose, i've added a x_nr procedure that returns
  ; a new unique number on every call
  ;
  ; you decide yourself if you want to free them or not :-)
  ; i would suggest doing so if you don't 'recycle' them using x_freenr()... 
  ;
  If CountList(x_nr_list()) > 0         ; which means there's some stuff on the list
    x_nr = x_nr_list()                  ; then use that number
    DeleteElement(x_nr_list())          ; and take if from the list
  Else
    x_nr = x_nr_n
    x_nr_n = x_nr_n+1
  EndIf
  ProcedureReturn x_nr
EndProcedure

Procedure x_freenr(n.l)
  ;
  ; *** recycles unique numbers
  ;
  ; put this number into the 'free numbers' list so it can be reused by x_nr()
  ;
  AddElement(x_nr_list())
  x_nr_list()=n
  ;
EndProcedure

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

So many requests - Maybe we need a poll so the dev team can prioritise! ) j/k :)

A new image gadget command that allows the image to be drawn onto any other gadget, eg:

Code: Select all

pasteImage(#imgID,#gadID,x,y,Wide,High[,flags])
which implies start/stop drawing and useImage.

And with a flag #PB_IMAGE_DIMENSIONS_AS_PERCENT

:D

Also with drawing2D directly to a gadget. eg:

Code: Select all

startDrawingON(#gadID) : .. : stopDrawingON([#gadID])
And whilst we're at it RealiseConcept(#userIDea, filename) which just reads your mind and writes the code. But that might be a bit hardware (with my head, anyway) specific.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

...and since there are no version 4 yet... :)

Sprite 3D for linux (and soon MacOSX). I know Fred said before that he will most likely not include Sprite3D commands for any other platform except windows. This neatly makes PureBasic worthless for linux/macOSX game progammers, however... one can wish :)
decoder
New User
New User
Posts: 3
Joined: Mon Jun 13, 2005 12:36 pm

Post by decoder »

1) True boolean variables
2) dim(2) -> 0,1 -not 0,1,2
3) ability to quote off blocks of text: %/ .. /% , not just line by line
4) automatic intidents on editor

thanks!
:D
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

This thread started Fri Oct 10, 2003 5:53 pm.
Is it been that long... :shock:
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Is it been that long...
Yes, :cry:
--Kale

Image
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

At that time there was the 3.80 release. PB has come a long way since then. (just look at the history)
quidquid Latine dictum sit altum videtur
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

I'd bet that some of the things on this thread are already implemented.
@}--`--,-- A rose by any other name ..
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

I want more graphix stuff, and a FlipBuffer() that don't use 100% CPU while it waits to flip the buffer.
And a SetFrameRate() that is accurate, I hate the way it's now... (it makes the game "laggy", I can give you an example if you want...)
And a HighRes timer.

Edit: And the help file could be more thecnically detailed,
for example how does actually the IF command work?
Does it stop testing if the first of all "Or <expression>" is true?
Yeah it does, but people might want to know stuff like that.
And that LoadSprite(9999,"file") reserve spritememory for all the 9998 sprites you don't use.

Maybe somebody allready suggested this, I didn't read all 7 pages...
I like logic, hence I dislike humans but love computers.
Post Reply