Count Selected Items with FileRequester

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Count Selected Items with FileRequester

Post by localmotion34 »

Sometimes, we need to know how many items were selected in a multiselect filerequester.

there are examples of while:wend with nextselectedfilename(), but i am requesting countselectedfilenames().

i think the way Fred has the Filerequester setup, the string returned is delimited with commas, which is then accessed by Nextselectedfilename().

Can you just make a command that counts the number of delimited strings returned by the Internal PB function and gives us a long number back?

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Count Selected Items with FileRequester

Post by PB »

Yes, it would be handy. After all, CountProgramParameters() exists and does
pretty much the same thing as what you're requesting, except for parameters.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Post Reply