Dave Merriman schrieb: > Is there a way to determine what directory a Gambas executable is run > from? Or what its 'default' directory is when looking for a file? > > I've got some text files that I need to read into an array (I *really* > wish Gambas had an easy way to embed array data _in_ the program, like > the old "data 4, 17, 32, 88..." of BASIC days), and need to know where > to put them so they're easily found. >
In this case, I think Application.Path will be your friend. Type it and press F2 while cursor is on Path, you'll get Application.Path (gb) Syntax STATIC PROPERTY READ Path AS String Returns the application path, i.e. the directory where it resides. As to DATA I agree - but there are a lot of ways you can handle this, e. g. by putting your data in strings or string arrays. The most practical way I found is putting such data into files with lines separated by TABs (chr$(9)). You can then easily read the file by File.Load into a string, split it into a string array by using Split with chr$(10) and work on each line by using Split with chr$(9). This works as fast as a DATA line would. Rolf ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user