[Gambas-user] file list in combobox

GuruLounge - MailLists maillists at ...1367...
Wed May 3 08:32:42 CEST 2006


Maybe it has something to do with paths being relative to the
executable.  Specifically implying the path in the fix forces gambas to
look in the actual directory.

Just a thot.

Jeff

On Tue, 2006-05-02 at 10:54 -0700, Peter Russell wrote:
> Hi all
> Using Version 1.0.15
> 
> I actually resolved this but thought it may be an issue worth
> commenting on.
> 
> I had the following code in my program for getting a number of files
> from a directory with the extension ending in .z and then removing the
> extension.
> ***************** 
>   sFiles = Dir("players", "*.z")
>   
>   cboxPlayers.Clear
>   
>   FOR EACH sFile IN sFiles
>     sName = Split(sFile, ".")
>     cboxPlayers.Add(sName[0],i)
>     INC i
>   NEXT
> ***********************
> 
> This ran fine until I created the exexcutable file where it crashed in
> this routine
> 
> The following  changes fixed the crash.
> 
> ********************
>   sPath = Application.Path & "/players"
>   
>   sFiles = Dir(sPath, "*.z")
>   
>   cboxPlayers.Clear
>   
>   FOR EACH sFile IN sFiles
>     sName = Split(sFile, ".")
>     cboxPlayers.Add(sName[0],i)
>     INC i
>   NEXT 
> ***************************
> 
> Strange! Hope this may help someone unless someone can enlighten me to
> a better way. 
> 
> Oh by the way I'm new to the list and only been messing with gambas a
> short while. In one word! Fantastic. Thanks.
> 
> Regards Pete 
> 
> 
> 
> ______________________________________________________________________
> Get amazing travel prices for air and hotel in one click on Yahoo!
> FareChase 
-- 

     .^.
     /V\
    /( )\
    ^^-^^
Linux Advocate





More information about the User mailing list