Hi,
I'm a beginner with PureBasic so may have overlooked the obvious, please excuse!
1. It would be good to have INC and DEC to increment/decrement a variable.
INC MyVariableName
is neater than:
MyVariableName = MyVariableName + 1
etc
2. SWAP(variable1, variable2)
This makes life so much quicker when writing sorting routines that involve multiple arrays
v.l = Sernum.l(n.w) : Sernum.l(n.w) = Sernum.l(n.w+1) : Sernum.l(n.w+1)=v.l
becomes
SWAP(Sernum.l(n.w) ,Sernum.l(n.w+1)
Should work with all variable types.
3. ARRAYFILL Arrayname(),Value
Great for initialising / clearing.
4. MID(String$,Posn,Limit) = Item$
Insertion is a neat way to build/modify strings.
I have acheived the function of all these suggestions by other means, but PB would be better with them.
Also, BMOVE, MEMBFILL would be nice...
My previous BASIC was 16bit GFA, so these are the things I miss when migrating programs to PB.
Apart from the standard editor, I'm acheiving results with PB... thats what counts.
jaBPe is an improvement
RichardL
New Key Words?
for your #1 use this :
so instead of your:
"INC MyVariableName"
do this:
MyVariableName + 1
Code: Select all
variable + <expression>
; it's the same as
variable = variable + <expression>
; this goes for all operators that need a LHS and RHS
"INC MyVariableName"
do this:
MyVariableName + 1
You can do Swap() with a procedure:
Notice that this works for Longs and Floats; if you want to swap Words or Bytes, you have to use PokeW,PeekW, and PokeB,PeekB.
Code: Select all
Procedure Swap(p1,p2)
Protected temp
temp.l=PeekL(p1) : PokeL(p1,PeekL(p2)) : PokeL(p2,temp)
EndProcedure
a=100 : b=200 :
Swap(@a,@b)
ah, INC... gfabasic users unite! 
turning asm on, you could do INC a
alternatives:
a=a+1
a+1
unfortunately, there's no a++ (which i liked, as my eyes somehow confuse my mind every time i see a a+1 without an '=' sign...)

turning asm on, you could do INC a
alternatives:
a=a+1
a+1
unfortunately, there's no a++ (which i liked, as my eyes somehow confuse my mind every time i see a a+1 without an '=' sign...)
( 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... )
( The path to enlightenment and the PureBasic Survival Guide right here... )