[Gambas-devel] Changes in gbx_c_settings.c

Leo Barnhoorn leo.barnhoorn at ...53...
Thu Sep 9 05:36:18 CEST 2004


Hello Benoit,

I hope it is no problem that i have make some changes in the gbx_c_settings.c 
file.

I make this changes because i want to use the settings normal, all the .conf 
en project file get the first 2 lines like this:

	# Gambas configuration file 1.0
	# for phpeditor

But when i make .conf and project file for my own program i want to see 
somthing like this:

	# PHPEdit Project File 1.0
	# for project Test

With the changes i have make this is now possible. It is working very well 
both the text are now available.

Example:

PUBLIC CONST PROJECT_MAGIC AS String = "PHPEdit Project File 1.0"

PUBLIC SUB btnOK_Click()
   DIM hProject AS Settings

   hProject = NEW Settings (sDir &/ ".project")
   
   hProject["/ProjectName"] = Trim(txtProjectName.Text)
   hProject["/ProjectTitle"] = txtProjectTitle.Text
   hProject["/ProjectDescription"] = txaProjectDescription.Text
   hProject["/ProjectVersion"] = "0.0.0"
   hProject["/ProjectDir"] = sDir
   
   'hProject.PName(Trim(txtProjectName.Text))
   'hProject.PString(PROJECT_MAGIC)
   hProject.Save

   ME.Close(TRUE)
END

This example make a project or .conf file like this:
# Gambas configuration file 1.0
# for phpeditor
/ProjectName="Test"
/ProjectTitle="This is a test project."
/ProjectDescription="This is a test project.\n\nBy Leo Barnhoorn.\n"
/ProjectVersion="0.0.0"
/ProjectDir="/srv/www/htdocs/Project/Test"

==============================================================

PUBLIC CONST PROJECT_MAGIC AS String = "PHPEdit Project File 1.0"

PUBLIC SUB btnOK_Click()
   DIM hProject AS Settings

   hProject = NEW Settings (sDir &/ ".project")
   
   hProject["/ProjectName"] = Trim(txtProjectName.Text)
   hProject["/ProjectTitle"] = txtProjectTitle.Text
   hProject["/ProjectDescription"] = txaProjectDescription.Text
   hProject["/ProjectVersion"] = "0.0.0"
   hProject["/ProjectDir"] = sDir
   
   hProject.PName(Trim(txtProjectName.Text))
   hProject.PString(PROJECT_MAGIC)
   hProject.Save

   ME.Close(TRUE)
END

This example make a project or .conf file like this:
# PHPEdit Project File 1.0
# for project Test
/ProjectName="Test"
/ProjectTitle="This is a test project."
/ProjectDescription="This is a test project.\n\nBy Leo Barnhoorn.\n"
/ProjectVersion="0.0.0"
/ProjectDir="/srv/www/htdocs/Project/Test"


Is it possible to make this part of Gambas Benoit.
I believe this is not proper way how to do it but i 'm happy that it is 
working on the way i have done it.

Regards,
Leo Barnhoorn.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gbx_c_settings.c
Type: text/x-csrc
Size: 9055 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20040909/8d12f7b4/attachment.c>


More information about the Devel mailing list