[Gambas-user] About changes in ListView, TreeView & ColumnView

Nelson Ferraz nferraz at ...184...
Sun Dec 14 16:13:29 CET 2003


Benoit Minisini wrote:
> I want to change the Dir$() function. Instead of behaving like the VB one, I 
> want it to return a Array of file names. This way, it will be simpler to 
> browser a directory. What do you think about that ?

This is a good idea.

The function could return a single value OR an array, depending on context:

   myItem  = Dir$() ' return a single item
   myArray = Dir$() ' return an array

Another thing, it would be interesting to have the following methods to 
deal with arrays: Shift, Unshift, Push and Pop.

   item = Shift (array)  ' get first item
   Unshift (array, item) ' insert an item at first position

   Push (array, item)    ' insert an item at last position
   item = Pop (array)    ' get last item

The Shift method, in particular, could be useful to emulate the former 
behaviour. Something like this:

myAray = Dir$()
WHILE (myArray)
   myItem = Shift (myArray)
   ' do something with myItem
END

-- 
[]s

Nelson

________________________________________________________________
Nelson Ferraz

GNU BIS: http://www.gnubis.com.br
PhPerl:  http://www.phperl.com






More information about the User mailing list