[Gambas-user] Accessing Project Data in a Text File

Bruce bbruen at ...2308...
Mon Feb 10 08:15:33 CET 2014


On Sun, 2014-02-09 at 22:06 -0800, Louis W. Adams, Jr. wrote:
> > Are you talking about your project at design time in the IDE or when your
> > project runs, i.e. do you want to look at the file or does your program
> > need
> > it at run time? I guess the second but it's not clear to me...
> 
> I added my data file (a text file) to the Data section of the project during
> design time because that's what I thought the Data section was for.  What is
> the purpose of associating a data file containing numerical information with
> a project by putting it on the list?  It sounds like I must access the data
> in exactly the same way whether or not the file is listed, by processing the
> file resident in the filing system.  So why don't I just leave it out of the
> project?  What's the point of listing it?  Why list anything in the Data
> section of a GAMBAS project?  Is the only purpose to make sure listed files
> are included in a source archive or an installation package for the project? 
> By adding a tab in the IDE with the data parsed and displayed, it looks like
> it has the same status as the form and class tabs (that is, it contains
> information resident in the project).  But I guess not.
> 
The files in the Data section are included in the gambas executable
archive. When you build that via Project|Make|Executable it includes
those files in the compressed "project".gambas file. 
They are accessed as "normal" files BUT they are referred to using
relative paths. This is explained in the Language Index of the help or
on the wiki at http://gambasdoc.org/help/cat/path?v3&help
There are a miriad of uses for this technique, project images for
buttons, static data referred to by the program etc etc. 
It is NOT for your program's volatile data! In fact, you cannot write to
one of these files from within the program (but you can from the IDE.)
One other wiki page may help you:
http://gambasdoc.org/help/doc/project_structure?v3

> I'm a GAMBAS beginner, so please be patient with my questions.  I'm still
> learning.  I can't find an answer to this question in documentation or books
> that I've checked.  In fact, I can't find anything written anywhere that
> explains the purpose of the Data section of a project in the GAMBAS IDE.
> 
> Lou
> 
No problems, we all started in the same boat.

Bruce






More information about the User mailing list