addelement() without parameter

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

addelement() without parameter

Post by blueznl »

how about this one?

addelement() without a list name affects the last addressed list
same for the other list commands

though i know when lists are adressed in procedures things can get nasty...

it's mostly to avoid these kind of thins:

addelement(test())
test()="test"

and change it to:

addelement()
test()="test"

when doing lots of stuff with lists in a small block of code it could improve readability
( 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... )
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

This system isn't thread safe, which is a big issue in PureBasic. All the commands which use a 'current' object instead of pointing it explicitely in the function is not thread compliant. I will probably rethink all this logic when string will be reworked (v4.0).
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

hmmm okay, i see, each thread doesn't store 'last used' information... that can be a bit risky :-)

i would assume the same would apply to all the drawing, windows etc. commands?
( 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... )
Post Reply