Wishlist for PB 7.0 :)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
idle
Always Here
Always Here
Posts: 6170
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Wishlist for PB 7.0 :)

Post by idle »

unsigned types
structures byval for params and returns so it's compatible with c, libs like chipmunk, raylib, miniaudio
defaults for structures and fill

Code: Select all

Procedure.vec2 VecScale(a.vec2,mag.f)  
    ;a by val , returns vec2 by val 
    define result.vec2  
    result\x  = a\x * mag
    result\y =  a\y * mag
   if mag <> 0   
      procedureReturn result 
   else 
     procedureReturn = {1.0,1.0}  ;default fill 
   endif            
EndProcedure  

mVec.vec2 = VecScale(a,0.5) 

;Defaults for structures 
structure foo 
  a.i = 123 
  b.s = "foo" 
  ar.i[10] = {1,2,3,4,5,6,7,8,9,10} 
EndStructure 

;fill arrays like c  
dim gA.Vec2() = {1,1,2,2,3,3,4,4,5,5}
r-i-v-e-r
User
User
Posts: 21
Joined: Thu May 09, 2024 5:18 pm

Re: Wishlist for PB 7.0 :)

Post by r-i-v-e-r »

idle wrote: Wed Jan 21, 2026 9:51 pm structures byval for params and returns so it's compatible with c, libs like chipmunk, raylib, miniaudio
+1000, so much this. I was actually writing a reply to IceSoft's structures by pointer request as you posted this.

Returning/receiving structures by-value C ABI style would be an incredible boon for me.

In order to interface w/ some Objective-C APIs, structures must be returned in this way. At present, this means I have to manually copy results into RAX/RDX/XMM/D0~D3 registers accordingly using inline ASM/C, which is pretty arduous. Though I've built helpers to deal w/ pretty much any case now, it'd be amazing to have this feature in-built so it's less clunky/fragile.
miso
Enthusiast
Enthusiast
Posts: 673
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Wishlist for PB 7.0 :)

Post by miso »

idle wrote: Wed Jan 21, 2026 9:51 pm unsigned types
structures byval for params and returns so it's compatible with c, libs like chipmunk, raylib, miniaudio
defaults for structures and fill

Code: Select all

Procedure.vec2 VecScale(a.vec2,mag.f)  
    ;a by val , returns vec2 by val 
    define result.vec2  
    result\x  = a\x * mag
    result\y =  a\y * mag
   if mag <> 0   
      procedureReturn result 
   else 
     procedureReturn = {1.0,1.0}  ;default fill 
   endif            
EndProcedure  

mVec.vec2 = VecScale(a,0.5) 

;Defaults for structures 
structure foo 
  a.i = 123 
  b.s = "foo" 
  ar.i[10] = {1,2,3,4,5,6,7,8,9,10} 
EndStructure 

;fill arrays like c  
dim gA.Vec2() = {1,1,2,2,3,3,4,4,5,5}
also +1 from me, those are handy
threedslider
Enthusiast
Enthusiast
Posts: 558
Joined: Sat Feb 12, 2022 7:15 pm

Re: Wishlist for PB 7.0 :)

Post by threedslider »

miso wrote: Wed Jan 21, 2026 10:21 pm
idle wrote: Wed Jan 21, 2026 9:51 pm unsigned types
structures byval for params and returns so it's compatible with c, libs like chipmunk, raylib, miniaudio
defaults for structures and fill

Code: Select all

Procedure.vec2 VecScale(a.vec2,mag.f)  
    ;a by val , returns vec2 by val 
    define result.vec2  
    result\x  = a\x * mag
    result\y =  a\y * mag
   if mag <> 0   
      procedureReturn result 
   else 
     procedureReturn = {1.0,1.0}  ;default fill 
   endif            
EndProcedure  

mVec.vec2 = VecScale(a,0.5) 

;Defaults for structures 
structure foo 
  a.i = 123 
  b.s = "foo" 
  ar.i[10] = {1,2,3,4,5,6,7,8,9,10} 
EndStructure 

;fill arrays like c  
dim gA.Vec2() = {1,1,2,2,3,3,4,4,5,5}
also +1 from me, those are handy
Woot ! Yeah, +100 for me as well :mrgreen:
User avatar
Nudgy
User
User
Posts: 28
Joined: Mon May 27, 2024 8:11 pm

Re: Wishlist for PB 7.0 :)

Post by Nudgy »

I am a simple man:

- Procedure declarations made optional (if not in modules)
- OS-agnostic paths for the include functions, so that it doesn't matter if I use / or \ for relative paths and don't have to use too many constants for this (like in FreeBasic)
miso
Enthusiast
Enthusiast
Posts: 673
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Wishlist for PB 7.0 :)

Post by miso »

Nudgy wrote: Thu Jan 22, 2026 8:58 am I am a simple man:

- Procedure declarations made optional (if not in modules)
- OS-agnostic paths for the include functions, so that it doesn't matter if I use / or \ for relative paths and don't have to use too many constants for this (like in FreeBasic)
+1
miso
Enthusiast
Enthusiast
Posts: 673
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Wishlist for PB 7.0 :)

Post by miso »

+1 For more unsigned native variables already mentioned by some. Particularly the missing 4 and 8 bytes long ones. Unsigned long, quad.
User avatar
skywalk
Addict
Addict
Posts: 4294
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Wishlist for PB 7.0 :)

Post by skywalk »

We're getting fast strings BEFORE v7.0 :shock:
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
IceSoft
Addict
Addict
Posts: 1708
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Wishlist for PB 7.0 :)

Post by IceSoft »

skywalk wrote: Sun Jan 25, 2026 5:28 pm We're getting fast strings BEFORE v7.0 :shock:
Why should we wait?
Belive! C++ version of Puzzle of Mystralia
Bug Planet
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
susan
User
User
Posts: 27
Joined: Mon Aug 08, 2022 4:06 am

Re: Wishlist for PB 7.0 :)

Post by susan »

In the IDE, be able to set a Breakpoint by a click in the left margin and/or add the Breakpoint command to the right-click pop-up menu.
Drone
User
User
Posts: 10
Joined: Fri May 03, 2019 10:21 pm

Re: Wishlist for PB 7.0 :)

Post by Drone »

susan wrote: Sun Jan 25, 2026 9:20 pm In the IDE, be able to set a Breakpoint by a click in the left margin and/or add the Breakpoint command to the right-click pop-up menu.
You can. Press Alt + Left mouse button on left margin or F9
User avatar
susan
User
User
Posts: 27
Joined: Mon Aug 08, 2022 4:06 am

Re: Wishlist for PB 7.0 :)

Post by susan »

Drone wrote: Sun Jan 25, 2026 11:07 pm You can. Press Alt + Left mouse button on left margin or F9
I knew about F9 since it's labelled in the menu, but Alt+Left click is much easier for the way I use the IDE, thank you!
Cezary
Enthusiast
Enthusiast
Posts: 118
Joined: Sun Feb 12, 2017 2:31 pm

Re: Wishlist for PB 7.0 :)

Post by Cezary »

It may be worth reminding this:

viewtopic.php?p=640651#p640651
Post Reply