New command : SortGadgetItems()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

New command : SortGadgetItems()

Post by Flype »

Just an idea :
Like the PURE_LVSORT user-library from Gnozal,
a SortGadgetItems() would be a nice feature and in the philosophy of purebasic.

Look at how i imagine such a command :

Code: Select all

Procedure.l SortGadgetItems(gID.l,column.l,type.l,option.l,mask.s)
  
  ; Description:
  ; 
  ; SortGadgetItems() --> Sort elements in a ListViewGadget/ListIconGadget
  ; 
  ; Input:
  ; 
  ; gID.l    --> GadgetID
  ; column.l --> Column Number (From O To n)
  ; type.l   --> #PB_Sort_Integer, #PB_Sort_Float, #PB_Sort_String, #PB_Sort_Date
  ; option.l --> #PB_Sort_Asc, #PB_Sort_Desc, #PB_Sort_CaseSensitive
  ; mask.l   --> In case of Date type : '%dd/%mm/%yyyy %hh:%ii'
  ; 
  ; Output:
  ; Returns #True  --> If Everything is OK.
  ; Returns #False --> If the specified gadget is not a list-type gadget.
  ; Returns #False --> If the specified column doesn't exists.
  ; Returns #False --> If the specified type isn't compatible with data presents in the column.
  
  Result.l
  
  ; <code>
  
  ProcedureReturn Result
  
EndProcedure
Best Regards,
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer