Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread jm
Richard,

You got same ideas I got!

I was going to write a gambas program to do the preprocessing, but
backed off because the issue then became which programs do you maintain?
The expanded ones that the IDE can run or the compact ones 
edited in a text editor without highlighting.
Lack of highlighting hugely reduces productivity.

[That leads to be another question for the knowledgeable.
 Does Gambas have any way of exporting IDE highlighted code as HTML?
 It will greatly assist me to have this feature when documenting code.
 save highlighed code in html turns up lots of results in google
 gambas save highlighed code in html turn up nothing relevant]


I trying an alternative work around as well where I use huge switch
statements. The constant that the switch statement execute are highly
verbose. e.g.

PRIVATE CONST CHANGE_BASE_COORDINATES_OF_FEET AS Integer = 4

and then calling a function like this:

   geometry(CHANGE_BASE_COORDINATES_OF_FEET)

and then in that function I have a huge switch statement.
I use OO almost everywhere, but this technique reduces the amount of OO
based dereferencing notation code. Code looks closer to C.
Code works well, and expands well.
The only thing lacking is the ability to use #include to
shovel the big switch functions to some other file to make files
even more readable.

Because I work in C, gambas, and other languages
I am conscious not to use language specific syntax wherever
possible. I've prototyped programs in gambas and gone to C this way. So
I know it works reasonably well providing you don't get too welded
to language specific code.

So for many different reasons which can't all be quickly covered in a
mailing list, and without getting into the merits
of OO only solution, (or bashing OO to justify adding #include) I
thought best to ask if C like #include and related pre-processing can be
added. It can all coexist and work well when used responsibly
for the many different coding styles that exist out there.



On Mon, 2012-06-11 at 20:27 +0100, RICHARD WALKER wrote:
 With apologies to all-who-know-more-about-this-than-me (or just all)...
 
 Joe, you have a problem with managing a growing Gambas codebase and
 you think having an #include method in Gambas would help you cope. We
 are agreed that if it were added then it would operate before the
 compiler kicks in to make code for the interpreter. That makes me ask
 the question; why reinvent the wheel?
 
 You already have at your disposal a program which fully understands
 what to do with #include (and all the other pre-processor directives
 which have been mentioned). Have you tried it out yet?
 
 You have another program which is ideally suited to managing the files
 for large text file processing projects. Why not have a go at knocking
 up a project definition file using all the #include and #define and
 #ifdef directives you need. Run that through the C pre-processor,
 maybe under the direction of a suitable makefile and see if you can
 create a Gambas project which the ide can then load (for checking?)
 and compile?
 
 This should work just as well for the forms as for the code as it is
 all just text files in the project. Could that work for you?
 
 Richard
 
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 __
 This message has been checked for viruses and spam by Armourplate
 http://www.armourplate.com, the email archiving, anti virus and anti spam
 service from Corpex.


__
This message has been checked for viruses and spam by Corpex using
the ArmourPlate Anti Virus and Anti Spam Scanning Service.
To find out more and see our email archiving service see
http://www.armourplate.com or call Corpex on UK 0845 050 1898.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread Rolf-Werner Eilert

 You already have at your disposal a program which fully understands
 what to do with #include (and all the other pre-processor directives
 which have been mentioned). Have you tried it out yet?


Is it possible to insert the C pre-processor into the Play-Button 
function of the Gambas IDE, maybe the way you can insert filters into 
kprinter? That would be ideal here.

Just an idea... :-)

Rolf


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread jm
On Tue, 2012-06-12 at 12:03 +0200, Rolf-Werner Eilert wrote:
  You already have at your disposal a program which fully understands
  what to do with #include (and all the other pre-processor directives
  which have been mentioned). Have you tried it out yet?
 
 
 Is it possible to insert the C pre-processor into the Play-Button 
 function of the Gambas IDE, maybe the way you can insert filters into 
 kprinter? That would be ideal here.
 
 Just an idea... :-)
 
 Rolf

Wow!

Thinking about it, that is even more powerful to cooperate
with external preprocessor than just adding preprocesor functionality on
its own.

A simple check box in project properties dialog box to enable/disable
preprocessing can turn the feature on/off. Some programs you may just
not want to allow preprocessing and so checking it off here will allow
the compiler to complain bitterly to go get it fixed.



__
This message has been checked for viruses and spam by Corpex using
the ArmourPlate Anti Virus and Anti Spam Scanning Service.
To find out more and see our email archiving service see
http://www.armourplate.com or call Corpex on UK 0845 050 1898.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread Rolf-Werner Eilert
Am 12.06.2012 13:41, schrieb Benoît Minisini:
 Le 12/06/2012 13:01, jm a écrit :
 On Tue, 2012-06-12 at 12:03 +0200, Rolf-Werner Eilert wrote:
 You already have at your disposal a program which fully understands
 what to do with #include (and all the other pre-processor directives
 which have been mentioned). Have you tried it out yet?


 Is it possible to insert the C pre-processor into the Play-Button
 function of the Gambas IDE, maybe the way you can insert filters into
 kprinter? That would be ideal here.

 Just an idea... :-)

 Rolf

 Wow!

 Thinking about it, that is even more powerful to cooperate
 with external preprocessor than just adding preprocesor functionality on
 its own.

 A simple check box in project properties dialog box to enable/disable
 preprocessing can turn the feature on/off. Some programs you may just
 not want to allow preprocessing and so checking it off here will allow
 the compiler to complain bitterly to go get it fixed.


 Hi,

 Sorry if I disappoint you, but I'm strongly against any preprocessing
 feature in Gambas.

 I'm talking about code subsitution, not the features currently
 implemented in the Gambas compiler, that just allow compiling one part
 of the code or another.

 Why ?

 Preprocessing is mainly used (in C) for the three following reasons:

 1) Function and variable declaration.
 2) Writing the same repeating pattern once.
 3) Writing generic functions.

 In interpreted OO languages, and especially in Gambas, these features
 are not needed:

 1) Function and variable declaration are done automatically by the compiler.
 2) OO has inheritance.
 3) There is no templates (or 'generic') in Gambas as in Java. But you
 have the Variant datatype.

 Moreover, preprocessing makes programs mostly unreadable, can create
 very difficult bugs, make the source code impossible to analyze (bye-bye
 automatic completion...), and so on.

 Developing a program is 20% writing it and 80% debugging it. So
 preprocessing makes that worse.

 If you need preprocessing in your project, then I think there is a
 fundamental design flaw in it. I have never need it when writing any big
 Gambas project.

 Regards,


Sigh... the master has spoken :-)



Regards

Rolf


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread Rolf-Werner Eilert
Am 12.06.2012 13:41, schrieb Benoît Minisini:
 Le 12/06/2012 13:01, jm a écrit :
 On Tue, 2012-06-12 at 12:03 +0200, Rolf-Werner Eilert wrote:
 You already have at your disposal a program which fully understands
 what to do with #include (and all the other pre-processor directives
 which have been mentioned). Have you tried it out yet?


 Is it possible to insert the C pre-processor into the Play-Button
 function of the Gambas IDE, maybe the way you can insert filters into
 kprinter? That would be ideal here.

 Just an idea... :-)

 Rolf

 Wow!

 Thinking about it, that is even more powerful to cooperate
 with external preprocessor than just adding preprocesor functionality on
 its own.

 A simple check box in project properties dialog box to enable/disable
 preprocessing can turn the feature on/off. Some programs you may just
 not want to allow preprocessing and so checking it off here will allow
 the compiler to complain bitterly to go get it fixed.



Now, let me add these few thoughts:


 I'm talking about code subsitution, not the features currently
 implemented in the Gambas compiler, that just allow compiling one part
 of the code or another.

(Are there any? Didn't even know that...)

 Moreover, preprocessing makes programs mostly unreadable, can create
 very difficult bugs, make the source code impossible to analyze (bye-bye
 automatic completion...), and so on.

Yes, automatic completion would mean browsing all #included files each 
time to search for keywords, but how do IDEs for C programming handle this?


 Developing a program is 20% writing it and 80% debugging it. So
 preprocessing makes that worse.

Guess you're darn right here...

There's just one more thing that popped into my mind, isn't it that a 
Gambas class code must adhere to certain rules as to where is what? I 
mean, you must start with variable declaration and then add the 
functions. You cannot declare a public variable at the end of the class, 
right?

So, if you could #include another, say file into the code, and this 
file contains variable declarations AND functions, you would get a lot 
of confusion if it was simply concatenated. Instead, an #include 
function would have to interpret the code at least a bit up to the point 
it could distinguish between variable declarations and functions to add 
the variable declarations to the others and the functions to the others 
in the temp file.

And so we are at the point we would have to code that ourselves and 
could not simply re-use the C preprocessor. It would at least be another 
obstacle.

Rolf

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread jm
On Tue, 2012-06-12 at 13:41 +0200, Benoît Minisini wrote:
 Le 12/06/2012 13:01, jm a écrit :
  On Tue, 2012-06-12 at 12:03 +0200, Rolf-Werner Eilert wrote:
  You already have at your disposal a program which fully understands
  what to do with #include (and all the other pre-processor directives
  which have been mentioned). Have you tried it out yet?
 
 
  Is it possible to insert the C pre-processor into the Play-Button
  function of the Gambas IDE, maybe the way you can insert filters into
  kprinter? That would be ideal here.
 
  Just an idea... :-)
 
  Rolf
 
  Wow!
 
  Thinking about it, that is even more powerful to cooperate
  with external preprocessor than just adding preprocesor functionality on
  its own.
 
  A simple check box in project properties dialog box to enable/disable
  preprocessing can turn the feature on/off. Some programs you may just
  not want to allow preprocessing and so checking it off here will allow
  the compiler to complain bitterly to go get it fixed.
 
 
 Hi,
 
 Sorry if I disappoint you, but I'm strongly against any preprocessing 
 feature in Gambas.
 
 I'm talking about code subsitution, not the features currently 
 implemented in the Gambas compiler, that just allow compiling one part 
 of the code or another.
 
 Why ?
 
 Preprocessing is mainly used (in C) for the three following reasons:
 
 1) Function and variable declaration.
 2) Writing the same repeating pattern once.
 3) Writing generic functions.
 
 In interpreted OO languages, and especially in Gambas, these features 
 are not needed:
 
 1) Function and variable declaration are done automatically by the compiler.
 2) OO has inheritance.
 3) There is no templates (or 'generic') in Gambas as in Java. But you 
 have the Variant datatype.
 
 Moreover, preprocessing makes programs mostly unreadable, can create 
 very difficult bugs, make the source code impossible to analyze (bye-bye 
 automatic completion...), and so on.
 
 Developing a program is 20% writing it and 80% debugging it. So 
 preprocessing makes that worse.
 
 If you need preprocessing in your project, then I think there is a 
 fundamental design flaw in it. I have never need it when writing any big 
 Gambas project.
 
 Regards,


I take it that is a definite no then? :-)

If I'm really under pressure, then I'm sure I can go
write a lite preprocessor as needed and manage.

Any chance of exporting IDE's highlighted code as colorful HTML
for documentation purposes?

Thank you, best regards.



__
This message has been checked for viruses and spam by Corpex using
the ArmourPlate Anti Virus and Anti Spam Scanning Service.
To find out more and see our email archiving service see
http://www.armourplate.com or call Corpex on UK 0845 050 1898.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread Randall Morgan
I don't know about Gambas but Python has many libraries for this. Just
google it. If you insist on pre-processing, a simple python script could
get it done quickly. I'm a firm believer in using the tool that makes the
most sense for the project. Of course, that depends on the person and
project

On Tue, Jun 12, 2012 at 7:30 AM, jm j...@martindale-electric.co.uk wrote:

 On Tue, 2012-06-12 at 13:41 +0200, Benoît Minisini wrote:
  Le 12/06/2012 13:01, jm a écrit :
   On Tue, 2012-06-12 at 12:03 +0200, Rolf-Werner Eilert wrote:
   You already have at your disposal a program which fully understands
   what to do with #include (and all the other pre-processor directives
   which have been mentioned). Have you tried it out yet?
  
  
   Is it possible to insert the C pre-processor into the Play-Button
   function of the Gambas IDE, maybe the way you can insert filters into
   kprinter? That would be ideal here.
  
   Just an idea... :-)
  
   Rolf
  
   Wow!
  
   Thinking about it, that is even more powerful to cooperate
   with external preprocessor than just adding preprocesor functionality
 on
   its own.
  
   A simple check box in project properties dialog box to enable/disable
   preprocessing can turn the feature on/off. Some programs you may just
   not want to allow preprocessing and so checking it off here will allow
   the compiler to complain bitterly to go get it fixed.
  
 
  Hi,
 
  Sorry if I disappoint you, but I'm strongly against any preprocessing
  feature in Gambas.
 
  I'm talking about code subsitution, not the features currently
  implemented in the Gambas compiler, that just allow compiling one part
  of the code or another.
 
  Why ?
 
  Preprocessing is mainly used (in C) for the three following reasons:
 
  1) Function and variable declaration.
  2) Writing the same repeating pattern once.
  3) Writing generic functions.
 
  In interpreted OO languages, and especially in Gambas, these features
  are not needed:
 
  1) Function and variable declaration are done automatically by the
 compiler.
  2) OO has inheritance.
  3) There is no templates (or 'generic') in Gambas as in Java. But you
  have the Variant datatype.
 
  Moreover, preprocessing makes programs mostly unreadable, can create
  very difficult bugs, make the source code impossible to analyze (bye-bye
  automatic completion...), and so on.
 
  Developing a program is 20% writing it and 80% debugging it. So
  preprocessing makes that worse.
 
  If you need preprocessing in your project, then I think there is a
  fundamental design flaw in it. I have never need it when writing any big
  Gambas project.
 
  Regards,


 I take it that is a definite no then? :-)

 If I'm really under pressure, then I'm sure I can go
 write a lite preprocessor as needed and manage.

 Any chance of exporting IDE's highlighted code as colorful HTML
 for documentation purposes?

 Thank you, best regards.




 __
 This message has been checked for viruses and spam by Corpex using
 the ArmourPlate Anti Virus and Anti Spam Scanning Service.
 To find out more and see our email archiving service see
 http://www.armourplate.com or call Corpex on UK 0845 050 1898.


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user




-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread jm

 Yes, automatic completion would mean browsing all #included files each 
 time to search for keywords, but how do IDEs for C programming handle this?

Netbeans and Eclipse do handle it 'reasonably' well.



__
This message has been checked for viruses and spam by Corpex using
the ArmourPlate Anti Virus and Anti Spam Scanning Service.
To find out more and see our email archiving service see
http://www.armourplate.com or call Corpex on UK 0845 050 1898.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread RICHARD WALKER
Do you need the syntax highlighting to be baked in? Can you not just
use Kate (in KDE) or Gedit with a suitable set of rules for their
existing highlighting mechanisms?

I remember a few years ago when I was using Gambas in a project for my
night-class in software engineering I was able to get syntax
highlighted code into Open Office and thence into pdf. From Open
Office I could move it to html for my slide presentation (didn't
want to go Powerpoint/Impress route).

I probably started by highlighting it in Kate as I remember writing
(modifying an existing) rule file. I started by just going through the
available syntax highlighters to find one that got me close - probably
KBasic - but I don't remember the details.

Richard.

On 12/06/2012, jm j...@martindale-electric.co.uk wrote:

 Yes, automatic completion would mean browsing all #included files each
 time to search for keywords, but how do IDEs for C programming handle
 this?

 Netbeans and Eclipse do handle it 'reasonably' well.



 __
 This message has been checked for viruses and spam by Corpex using
 the ArmourPlate Anti Virus and Anti Spam Scanning Service.
 To find out more and see our email archiving service see
 http://www.armourplate.com or call Corpex on UK 0845 050 1898.

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread Benoît Minisini
 Le 12/06/2012 16:30, jm a écrit :

 Any chance of exporting IDE's highlighted code as colorful HTML
 for documentation purposes?


As for that, it is not very difficult to implement, as you have access 
to the internal Gambas highlighter through the gb.eval component.

I will see if I can add that feature inside the IDE for you.

Regards,

-- 
Benoît Minisini

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-12 Thread tobi
On Tue, 12 Jun 2012, Rolf-Werner Eilert wrote:
 Am 12.06.2012 13:41, schrieb Benoît Minisini:
  Le 12/06/2012 13:01, jm a écrit :
  On Tue, 2012-06-12 at 12:03 +0200, Rolf-Werner Eilert wrote:
  You already have at your disposal a program which fully understands
  what to do with #include (and all the other pre-processor directives
  which have been mentioned). Have you tried it out yet?
 
 
  Is it possible to insert the C pre-processor into the Play-Button
  function of the Gambas IDE, maybe the way you can insert filters into
  kprinter? That would be ideal here.
 
  Just an idea... :-)
 
  Rolf
 
  Wow!
 
  Thinking about it, that is even more powerful to cooperate
  with external preprocessor than just adding preprocesor functionality on
  its own.
 
  A simple check box in project properties dialog box to enable/disable
  preprocessing can turn the feature on/off. Some programs you may just
  not want to allow preprocessing and so checking it off here will allow
  the compiler to complain bitterly to go get it fixed.
 
 
 
 Now, let me add these few thoughts:
 
 
  I'm talking about code subsitution, not the features currently
  implemented in the Gambas compiler, that just allow compiling one part
  of the code or another.
 
 (Are there any? Didn't even know that...)
 
  Moreover, preprocessing makes programs mostly unreadable, can create
  very difficult bugs, make the source code impossible to analyze (bye-bye
  automatic completion...), and so on.
 
 Yes, automatic completion would mean browsing all #included files each 
 time to search for keywords, but how do IDEs for C programming handle this?
 

You talked about IDEs but also vim as an editor can be made using ctags for 
this purpose

Regards,
Tobi

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread jm
Thank you Jussi.

That is just fantastic example that I intend to use for new projects.

The point I am trying to make should not have to become an OO v non-OO
programming debate.

The broadest difference is that #include and its cousins (#define,
#undefine, #ifdef, #ifndef, #endif) are to do with preprocessing before
a program runs.

I cover the argument in next post to Bruce.




On Sat, 2012-06-09 at 18:27 +0300, Jussi Lahtinen wrote:
 OK, while that solution might work, it sucks.
 Instead see new attachment (IncludeProblem-2.0.tar.gz).
 
 Jussi
 
 
 
 On 9 June 2012 16:57, Jussi Lahtinen jussi.lahti...@gmail.com wrote:
 
  Thinking more closely your problem, I think I know what you need.
 
  You try to avoid writing *many* lines like this;
  sParameterNameArray = NEW String[MAXIMUM_CSV_PARAMETERS]
 
  That is caused by broken object design, usually because you need to use
  old code which had different approach than OO.
  I have had same problems.
 
  I attached my suggestion how to implement this
  (IncludeProblem-0.0.1.tar.gz).
  Is it working solution?
 
  Jussi
 
 
 
 
 
 
  On 9 June 2012 16:18, Jussi Lahtinen jussi.lahti...@gmail.com wrote:
 
 
  C thrives on #include without showing signs of design problems.
 
 
  Yes, I know, I wasn't talking about C, I was talking about object
  oriented language, Gambas.
 
 
 
 
  Tens of thousands of external lines of code can be pulled in with
  a dozen #include statements, leaving the code completely manageable,
  readable and a lot more powerful than any other competing method.
 
 
  Yes, but you use #include with libraries, not with programs that aren't
  designed for that.
  Or you have design problem.
 
 
 
  For example, in module_a.module you might have
 
 ...
 
 
  and in a file called initialise_csv_variables.include it would contain:
 
   PRIVATE WordMarker1 AS Integer
   :
   '200 further variable declarations and initialisations
   :
   PRIVATE sParameterNameArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
   PRIVATE sParameterValueArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
 
  The #include files can contain any amount of well trodden
  proven gambas code which is maintained in only one file.
 
 
  So, basically you would add module/class called initialise_csv_variables,
  and you use that module/class in modules a and b.
 
 
 
 
  I will argue that adding C like #include functionality saves a ton of
  work in mega programs which are already working well, but now
  needs to be expanded even further.
 
 
  I don't understand how.
  You would still need to write that initialise_csv_variables.include file,
  you could as well write it as module/class.
 
  Jussi
 
 
 
 
 __
 This message has been checked for viruses and spam by Armourplate
 http://www.armourplate.com, the email archiving, anti virus and anti spam
 service from Corpex.
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___ Gambas-user mailing list 
 Gambas-user@lists.sourceforge.net 
 https://lists.sourceforge.net/lists/listinfo/gambas-user


__
This message has been checked for viruses and spam by Corpex using
the ArmourPlate Anti Virus and Anti Spam Scanning Service.
To find out more and see our email archiving service see
http://www.armourplate.com or call Corpex on UK 0845 050 1898.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread jm
Hi Bruce,

The broadest difference between #include (and its cousins #define,
#undefine, #ifdef, #ifndef and #endif) and OO programming is that
#include is a preprocessing command that gets to work long before a
program gets to run.

Using #include and its cousins, the idea is to build big readable
programs with the least amount of physical typing effort when used
responsibly.

I think if it gets pitched as a battle between OO and non-OO
programming, the debate is still probably winnable by providing lots of
examples where OO programming leads to more work. Basically if all the
#include functionality is performed in OO, you got to
keep track of objects, and as programs get more complex the syntax will
grow which is excessive physical typing and leads to this method of
writing programs:

object1.object_within_object.object_within_that_object.method(parameters1,..)

This can also turn into run time expense by having to dereference stuff.

[I guess that will in turn let the OO camp will post ample examples of
programming that leads to confusion where a use a of a #include 
is used irresponsibly and has altered programming behaviour in
unexpected ways.
This in turn will allow the #include camp to post more example where
OO behaviour leads to unexpected results confusing the programmer.

Lets not go there!!
]

Instead of that, it is simpler to put aside the OO v non-OO debate
and focus on merits of gambas having pre-processing functions
as a subject in its own right.

A #include that bolts together programs as needed.
When the run button is pressed on the IDE, the idea is that gambas will
do the pre-processing and stitch together the files to make a giant file
save it to disk as say file_name_to_run.expanded and then run that
expanded file.

When debugging, there will have to be some kind of option to switch
between expanded version of the file and non-expanded version of the
file.


Any chance of sneaking in this pre-processing 
productivity enhancing feature? :-)




On Sat, 2012-06-09 at 23:30 +0930, Bruce wrote:
 On Sat, 2012-06-09 at 13:51 +0100, jm wrote:
  On Sat, 2012-06-09 at 02:45 +0300, Jussi Lahtinen wrote:
   Maybe I'm just too tired, but I don't understand the point.
 
 Jussi, maybe I'm just too old as well as tired, but I can't grasp the
 point of taking an object oriented language and trying to jam an old
 (albeit well tested) non-OO concept into it.
 
 Joe, I am having some degree of trouble really understanding your value
 proposition. Especially the last post (which I have snipped in entirety,
 sorry). All I can grasp from reading it several times is that you feel
 that #include has some productivity value in providing what we call
 inheritance and polymorphism.
 
 I am not trying to put you down but I really can't grasp the ideas of
 thousands of parameters and hundreds of initialisations.  
 
 { We, here at paddys-hill have tens of clients (well a few tens anyway )
 that use a dozen or so applications, the code base encompasses around
 two hundred or so classes and modules organized into around thirty
 components and libraries.  The total code size is less than 25,000 lines
 and I would guess that probably 60% or more of that is comments. At a
 guess, the largest method calls would be 7 parameters, and they are
 just convenience calls to a class constructor.  By far the largest
 chunk of code is a library that downloads the text of around 40 web
 pages a day (about 40,000 text lines), parses them, normalises them and
 uploads them to the central database. I just checked and it's 6345 lines
 of code, so about 2400 working lines, which are mainly involved in text
 parsing (things like discerning Mac Donald and MacDonald or Miss
 Jane O'Donnel and Ms Jan ODonnell are the same names). The primary
 application that uses this library runs once a day and adds about 1200
 rows to a central postgresql database and can update anywhere between 2
 and 10,000 other rows.  It takes about 10 minutes.  The central
 database has just over 3.2 million rows, the clients each have a
 sub-mirrored database of who-knows-what size.}
 
 Anyway, I hope you can see from the above {} that those numbers you are
 using are fairly un-emotive to the reader.  
 
 regards
 Bruce
 
 
 
 
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 __
 This message has been checked for viruses and spam by Armourplate
 http://www.armourplate.com, the 

Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread Jussi Lahtinen
I think this;
object1.object_within_object.object_within_that_object.method(parameters1,..)
can be avoided with good object design. I still can't see real usage for
#include.
Also should be noticed that new keywords are justified only if they have
general usage.

But after all this is decision of Benoit, whether he sees usage for
#include or not.

Jussi





On 11 June 2012 11:10, jm j...@martindale-electric.co.uk wrote:

 Hi Bruce,

 The broadest difference between #include (and its cousins #define,
 #undefine, #ifdef, #ifndef and #endif) and OO programming is that
 #include is a preprocessing command that gets to work long before a
 program gets to run.

 Using #include and its cousins, the idea is to build big readable
 programs with the least amount of physical typing effort when used
 responsibly.

 I think if it gets pitched as a battle between OO and non-OO
 programming, the debate is still probably winnable by providing lots of
 examples where OO programming leads to more work. Basically if all the
 #include functionality is performed in OO, you got to
 keep track of objects, and as programs get more complex the syntax will
 grow which is excessive physical typing and leads to this method of
 writing programs:


 object1.object_within_object.object_within_that_object.method(parameters1,..)

 This can also turn into run time expense by having to dereference stuff.

 [I guess that will in turn let the OO camp will post ample examples of
 programming that leads to confusion where a use a of a #include
 is used irresponsibly and has altered programming behaviour in
 unexpected ways.
 This in turn will allow the #include camp to post more example where
 OO behaviour leads to unexpected results confusing the programmer.

 Lets not go there!!
 ]

 Instead of that, it is simpler to put aside the OO v non-OO debate
 and focus on merits of gambas having pre-processing functions
 as a subject in its own right.

 A #include that bolts together programs as needed.
 When the run button is pressed on the IDE, the idea is that gambas will
 do the pre-processing and stitch together the files to make a giant file
 save it to disk as say file_name_to_run.expanded and then run that
 expanded file.

 When debugging, there will have to be some kind of option to switch
 between expanded version of the file and non-expanded version of the
 file.


 Any chance of sneaking in this pre-processing
 productivity enhancing feature? :-)




 On Sat, 2012-06-09 at 23:30 +0930, Bruce wrote:
  On Sat, 2012-06-09 at 13:51 +0100, jm wrote:
   On Sat, 2012-06-09 at 02:45 +0300, Jussi Lahtinen wrote:
Maybe I'm just too tired, but I don't understand the point.
 
  Jussi, maybe I'm just too old as well as tired, but I can't grasp the
  point of taking an object oriented language and trying to jam an old
  (albeit well tested) non-OO concept into it.
 
  Joe, I am having some degree of trouble really understanding your value
  proposition. Especially the last post (which I have snipped in entirety,
  sorry). All I can grasp from reading it several times is that you feel
  that #include has some productivity value in providing what we call
  inheritance and polymorphism.
 
  I am not trying to put you down but I really can't grasp the ideas of
  thousands of parameters and hundreds of initialisations.
 
  { We, here at paddys-hill have tens of clients (well a few tens anyway )
  that use a dozen or so applications, the code base encompasses around
  two hundred or so classes and modules organized into around thirty
  components and libraries.  The total code size is less than 25,000 lines
  and I would guess that probably 60% or more of that is comments. At a
  guess, the largest method calls would be 7 parameters, and they are
  just convenience calls to a class constructor.  By far the largest
  chunk of code is a library that downloads the text of around 40 web
  pages a day (about 40,000 text lines), parses them, normalises them and
  uploads them to the central database. I just checked and it's 6345 lines
  of code, so about 2400 working lines, which are mainly involved in text
  parsing (things like discerning Mac Donald and MacDonald or Miss
  Jane O'Donnel and Ms Jan ODonnell are the same names). The primary
  application that uses this library runs once a day and adds about 1200
  rows to a central postgresql database and can update anywhere between 2
  and 10,000 other rows.  It takes about 10 minutes.  The central
  database has just over 3.2 million rows, the clients each have a
  sub-mirrored database of who-knows-what size.}
 
  Anyway, I hope you can see from the above {} that those numbers you are
  using are fairly un-emotive to the reader.
 
  regards
  Bruce
 
 
 
 
 
 --
  Live Security Virtual Conference
  Exclusive live event will cover all the ways today's security and
  threat landscape has changed and how IT managers can respond. 

Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread Randall Morgan
Hi Folks,

Thought I would chime in on this issue. As I see it include is a
pre-processing directive. It simply replaces the #include statement with
the contents of an external file. This is a project management
consideration and not a programming paradigm i.e. OOP, Functional,
Procedural, etc.. The include statement in C/C++ was intended to allow
libraries of code to be pulled into the current project. Allowing the
developer to split a large project up into smaller, more manageable files.
While it is used to include header files for libraries, it can be used to
include any text file. It is not a part of the formal language in C/C++.
But is a compiler re-processor.

Contrast this to Ada's use of packages. Package Specifications in Ada at
first seem similar to C header and library files. The major difference is
that packages are a formal part of the Ada language and as such the
compiler knows details about what is in the file and how to use that
information. It is not simply included as text the current compilation. In
fact many Ada compilers use the package specification file to locate and
bind to only the information needed from the package body and any further
dependent data/functions those dependencies may need.

So the question is not one of programming paradigm or language constructs
when it comes to includes. But one of file management. Frankly, I'd love to
see something more inline with Ada Packages placed into Gambas. Then you
could create something that looked like C/C++ includes but would be much
more powerful! However, from a Basic Language stand-point, I don't think
packages are very Basic-like... As for includes, I think this could be a
useful tool for some but wonder why simply refactoring the program into
more manageable class' wouldn't give a better solution. IMHO, doing so
would make the project more maintainable over the long haul





On Mon, Jun 11, 2012 at 8:42 AM, Jussi Lahtinen jussi.lahti...@gmail.comwrote:

 I think this;

 object1.object_within_object.object_within_that_object.method(parameters1,..)
 can be avoided with good object design. I still can't see real usage for
 #include.
 Also should be noticed that new keywords are justified only if they have
 general usage.

 But after all this is decision of Benoit, whether he sees usage for
 #include or not.

 Jussi





 On 11 June 2012 11:10, jm j...@martindale-electric.co.uk wrote:

  Hi Bruce,
 
  The broadest difference between #include (and its cousins #define,
  #undefine, #ifdef, #ifndef and #endif) and OO programming is that
  #include is a preprocessing command that gets to work long before a
  program gets to run.
 
  Using #include and its cousins, the idea is to build big readable
  programs with the least amount of physical typing effort when used
  responsibly.
 
  I think if it gets pitched as a battle between OO and non-OO
  programming, the debate is still probably winnable by providing lots of
  examples where OO programming leads to more work. Basically if all the
  #include functionality is performed in OO, you got to
  keep track of objects, and as programs get more complex the syntax will
  grow which is excessive physical typing and leads to this method of
  writing programs:
 
 
 
 object1.object_within_object.object_within_that_object.method(parameters1,..)
 
  This can also turn into run time expense by having to dereference stuff.
 
  [I guess that will in turn let the OO camp will post ample examples of
  programming that leads to confusion where a use a of a #include
  is used irresponsibly and has altered programming behaviour in
  unexpected ways.
  This in turn will allow the #include camp to post more example where
  OO behaviour leads to unexpected results confusing the programmer.
 
  Lets not go there!!
  ]
 
  Instead of that, it is simpler to put aside the OO v non-OO debate
  and focus on merits of gambas having pre-processing functions
  as a subject in its own right.
 
  A #include that bolts together programs as needed.
  When the run button is pressed on the IDE, the idea is that gambas will
  do the pre-processing and stitch together the files to make a giant file
  save it to disk as say file_name_to_run.expanded and then run that
  expanded file.
 
  When debugging, there will have to be some kind of option to switch
  between expanded version of the file and non-expanded version of the
  file.
 
 
  Any chance of sneaking in this pre-processing
  productivity enhancing feature? :-)
 
 
 
 
  On Sat, 2012-06-09 at 23:30 +0930, Bruce wrote:
   On Sat, 2012-06-09 at 13:51 +0100, jm wrote:
On Sat, 2012-06-09 at 02:45 +0300, Jussi Lahtinen wrote:
 Maybe I'm just too tired, but I don't understand the point.
  
   Jussi, maybe I'm just too old as well as tired, but I can't grasp the
   point of taking an object oriented language and trying to jam an old
   (albeit well tested) non-OO concept into it.
  
   Joe, I am having some degree of trouble really understanding your value
  

Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread Jussi Lahtinen
 As I see it include is a pre-processing directive. It simply replaces the
 #include statement with
 the contents of an external file. This is a project management
 consideration and not a programming paradigm i.e. OOP, Functional,
 Procedural, etc..


I agree, but I think with OOP, C style #include is obsolete management
choice.



The include statement in C/C++ was intended to allow
 libraries of code to be pulled into the current project.


Here is the main point.
In Gambas we already have Extern, Export etc commands for external
libraries,
whether they are written with Gambas, C or whatever.




 Allowing the developer to split a large project up into smaller, more
 manageable files.


With OOP I don't think you need to do that with files, you do it with
classes.
But maybe someone want to write code with non-OO style.




 Contrast this to Ada's use of packages.


I don't know Ada, so I cannot say anything it being useful in Gambas.



As for includes, I think this could be a useful tool for some but wonder
 why simply refactoring the program into
 more manageable class' wouldn't give a better solution. IMHO, doing so
 would make the project more maintainable over the long haul


I agree.



Jussi
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread Randall Morgan
Hi Jussi,

I don't think that OOP by itself replaces #includes. No more than OOP would
replace SVN, CVS, Merc, etc.. Look at any reasonably sized C/C++ project
and you'll see plenty of includes. I think the real issue here is the
language choice.

Gambas provides file management for it's projects. Using Gambas you can get
file management for free by splitting a project into many classes which in
Gambas results in the IDE managing these as different files. This is not
necessarily the case with other OOP languages.

So I think we agree on #includes not being the best solution for file
management under Gambas, however, I think our reasoning differs...

I'd also think that if an old project has grown to the point that someone
is looking for a way to manage it's files, then it has matured to a point
where refactoring the program would result in better long term management
of the project.




On Mon, Jun 11, 2012 at 10:38 AM, Jussi Lahtinen
jussi.lahti...@gmail.comwrote:

  As I see it include is a pre-processing directive. It simply replaces the
  #include statement with
  the contents of an external file. This is a project management
  consideration and not a programming paradigm i.e. OOP, Functional,
  Procedural, etc..


 I agree, but I think with OOP, C style #include is obsolete management
 choice.



 The include statement in C/C++ was intended to allow
  libraries of code to be pulled into the current project.


 Here is the main point.
 In Gambas we already have Extern, Export etc commands for external
 libraries,
 whether they are written with Gambas, C or whatever.




  Allowing the developer to split a large project up into smaller, more
  manageable files.
 

 With OOP I don't think you need to do that with files, you do it with
 classes.
 But maybe someone want to write code with non-OO style.




  Contrast this to Ada's use of packages.
 

 I don't know Ada, so I cannot say anything it being useful in Gambas.



 As for includes, I think this could be a useful tool for some but wonder
  why simply refactoring the program into
  more manageable class' wouldn't give a better solution. IMHO, doing so
  would make the project more maintainable over the long haul
 

 I agree.



 Jussi

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user




-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread tobi
On Mon, 11 Jun 2012, Jussi Lahtinen wrote:
  As I see it include is a pre-processing directive. It simply replaces the
  #include statement with
  the contents of an external file. This is a project management
  consideration and not a programming paradigm i.e. OOP, Functional,
  Procedural, etc..
 
 
 I agree, but I think with OOP, C style #include is obsolete management
 choice.
 
 
 
 The include statement in C/C++ was intended to allow
  libraries of code to be pulled into the current project.
 
 
 Here is the main point.
 In Gambas we already have Extern, Export etc commands for external
 libraries,
 whether they are written with Gambas, C or whatever.
 
 
 
 
  Allowing the developer to split a large project up into smaller, more
  manageable files.
 
 
 With OOP I don't think you need to do that with files, you do it with
 classes.
 But maybe someone want to write code with non-OO style.
 
 
 
 
  Contrast this to Ada's use of packages.
 
 
 I don't know Ada, so I cannot say anything it being useful in Gambas.
 
 
 
 As for includes, I think this could be a useful tool for some but wonder
  why simply refactoring the program into
  more manageable class' wouldn't give a better solution. IMHO, doing so
  would make the project more maintainable over the long haul
 
 
 I agree.
 
 
 
 Jussi
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

Hi,

I first didn't want to interfere but there recently was a related thread here.
Benoît stated back then that only the really needed features will be 
implemented in the Gambas
Preprocessor and scolded me for my proposition to use the CPP instead.
Nonetheless, if you really want to use the #include directive and other c-style 
things in your
own dark chamber, nobody would care if you maintain your sources split, merge 
them via #include
and then push them through the gbc3. As indirectly quoted above, it is not a 
solution for future
gambas and I would strongly prefer OO over this but if you need it, why not...

Uhh, too late to respond to Randall's last post but I totally recommend his 
last point.

Regards,
Tobi

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread Jussi Lahtinen
 Gambas provides file management for it's projects. Using Gambas you can get
 file management for free by splitting a project into many classes which in
 Gambas results in the IDE managing these as different files. This is not
 necessarily the case with other OOP languages.


OK, now I think I understand your point.
In some language all classes could be in one big file, then I agree that
#include would be useful.



So I think we agree on #includes not being the best solution for file
 management under Gambas, however, I think our reasoning differs...

 I'd also think that if an old project has grown to the point that someone
 is looking for a way to manage it's files, then it has matured to a point
 where refactoring the program would result in better long term management
 of the project.


Yeah, I think we completely agree now, and I think we should stop flooding
this list with this topic until Benoit makes his decision.


Jussi
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-11 Thread RICHARD WALKER
With apologies to all-who-know-more-about-this-than-me (or just all)...

Joe, you have a problem with managing a growing Gambas codebase and
you think having an #include method in Gambas would help you cope. We
are agreed that if it were added then it would operate before the
compiler kicks in to make code for the interpreter. That makes me ask
the question; why reinvent the wheel?

You already have at your disposal a program which fully understands
what to do with #include (and all the other pre-processor directives
which have been mentioned). Have you tried it out yet?

You have another program which is ideally suited to managing the files
for large text file processing projects. Why not have a go at knocking
up a project definition file using all the #include and #define and
#ifdef directives you need. Run that through the C pre-processor,
maybe under the direction of a suitable makefile and see if you can
create a Gambas project which the ide can then load (for checking?)
and compile?

This should work just as well for the forms as for the code as it is
all just text files in the project. Could that work for you?

Richard

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread fire666

well in gambas you can include differently afaik

try turning on and off: project -- properties -- components
if you don't have some turned on you can't do some stuff


jm-24 wrote:
 
 C like #include files for gambas?
 
 Sounds a bit harsh I know, but is it possible to add a feature
 that functions like a C #include?
 
 The logic behind is to address programs that are growing
 out of control in size. These are working megalithic programs that
 have had years of code piled on top of other code.
 The code has lost none of their lustre and needs to be
 expanded even more and that bit is being held up
 by this issue:
 
 If I break down programs into modules, then there is a huge
 overhead in passing parameters.
 
 If I break it down into classes, there is still a huge overhead
 in setting up classes and passing data around.
 
 These are programs that require hundred(s) of parameters to be
 set up if they are to pass data around to do one simple thing
 correctly.
 
 I have no problems doing it, but its boring and now becoming
 prone to mistakes in the way the parameters are being set up,
 and the order in which objects are being created.
 It is difficult to keep track of thousands of things at the
 same time.
 
 So I was thinking, it would be better to allow gambas programs
 to grow in size to reduce the number of different ways the
 objects are set up. But that is fatal, because you just can't find stuff
 quickly enough when you got tens of thousands of lines.
 
 I also program in C, and #include is a common way to
 pull in stuff from all over the place. It is a way to
 pull in mega numbers of .h and .c program files from all over the place
 and make a huge program without actually writing uneditable huge
 programs.
 
 The individual .c and .h programs make life so easy to debug
 and mix and match files as you need it by using a #include
 at the time and place you need it.
 Each of the .h and .c programs are separately maintained.
 Because there is only one .h file or one .c file,
 there is never any mistakes during duplication.
 
 If gambas supported #include, it would be possible
 to use #include to pull in variable declarations,
 and snippets of well trodden code as needed without having
 to copy and paste that would otherwise end up with numerous copies
 of similar code. Instead there will be just a couple
 of files that gets pulled in as needed with a #include.
 
 Any chance of sneaking in this productivity enhancing feature? :-)
 
 
 
 __
 This message has been checked for viruses and spam by Corpex using
 the ArmourPlate Anti Virus and Anti Spam Scanning Service.
 To find out more and see our email archiving service see
 http://www.armourplate.com or call Corpex on UK 0845 050 1898.
 
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 
 

-- 
View this message in context: 
http://old.nabble.com/C-like--include-for-Gambas-tp33984378p33985552.html
Sent from the gambas-user mailing list archive at Nabble.com.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread Jussi Lahtinen
Maybe you need to use Export?
http://gambasdoc.org/help/lang/export?v3

Jussi



On 9 June 2012 01:16, jm j...@martindale-electric.co.uk wrote:

 C like #include files for gambas?

 Sounds a bit harsh I know, but is it possible to add a feature
 that functions like a C #include?

 The logic behind is to address programs that are growing
 out of control in size. These are working megalithic programs that
 have had years of code piled on top of other code.
 The code has lost none of their lustre and needs to be
 expanded even more and that bit is being held up
 by this issue:

 If I break down programs into modules, then there is a huge
 overhead in passing parameters.

 If I break it down into classes, there is still a huge overhead
 in setting up classes and passing data around.

 These are programs that require hundred(s) of parameters to be
 set up if they are to pass data around to do one simple thing
 correctly.

 I have no problems doing it, but its boring and now becoming
 prone to mistakes in the way the parameters are being set up,
 and the order in which objects are being created.
 It is difficult to keep track of thousands of things at the
 same time.

 So I was thinking, it would be better to allow gambas programs
 to grow in size to reduce the number of different ways the
 objects are set up. But that is fatal, because you just can't find stuff
 quickly enough when you got tens of thousands of lines.

 I also program in C, and #include is a common way to
 pull in stuff from all over the place. It is a way to
 pull in mega numbers of .h and .c program files from all over the place
 and make a huge program without actually writing uneditable huge
 programs.

 The individual .c and .h programs make life so easy to debug
 and mix and match files as you need it by using a #include
 at the time and place you need it.
 Each of the .h and .c programs are separately maintained.
 Because there is only one .h file or one .c file,
 there is never any mistakes during duplication.

 If gambas supported #include, it would be possible
 to use #include to pull in variable declarations,
 and snippets of well trodden code as needed without having
 to copy and paste that would otherwise end up with numerous copies
 of similar code. Instead there will be just a couple
 of files that gets pulled in as needed with a #include.

 Any chance of sneaking in this productivity enhancing feature? :-)




 __
 This message has been checked for viruses and spam by Corpex using
 the ArmourPlate Anti Virus and Anti Spam Scanning Service.
 To find out more and see our email archiving service see
 http://www.armourplate.com or call Corpex on UK 0845 050 1898.


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread jm
On Sat, 2012-06-09 at 02:45 +0300, Jussi Lahtinen wrote:
 Maybe I'm just too tired, but I don't understand the point.
 
 If you have huge program that needs to be expended just a little bit,
 then why don't you just add new class/module/piece of code/etc which holds
 that new thing to the program?
 
 Or if you need something from the program like #include yourmodule then
 just write yourmodule.whateveryouneed.
 
 This sounds more like design problem of the code, than limitation of Gambas.
 
 Jussi
 
 

C thrives on #include without showing signs of design problems.
Tens of thousands of external lines of code can be pulled in with
a dozen #include statements, leaving the code completely manageable,
readable and a lot more powerful than any other competing method.

The nearest competing method is use of modules and classes but these
are nowhere near as powerful for the simple reason explained previously
which is that large versions of these objects cannot be initialised
without expending large amounts of effort at initialising them.

For example, in module_a.module you might have

  PRIVATE CONST MAXIMUM_CSV_PARAMETERS AS Integer = 100
  PRIVATE WordMarker1 AS Integer
  :
  '200 further variable declarations and initialisations
  :
  PRIVATE sParameterNameArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
  PRIVATE sParameterValueArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
  '
  'add more code specific to module_a

In module_b.module you might have

  PRIVATE CONST MAXIMUM_CSV_PARAMETERS AS Integer = 300
  PRIVATE WordMarker1 AS Integer
  :
  '200 further variable declarations and initialisations
  :
  PRIVATE sParameterNameArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
  PRIVATE sParameterValueArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
  '
  'add more code specific to module_b


It would be simpler to have C like # include to increase
the programming power. So in module_a.module the program would
read like a C #include:

  PRIVATE CONST MAXIMUM_CSV_PARAMETERS AS Integer = 100
  #include initialise_csv_variables.include
  '
  'add more code specific to module_a

and in module_b.module it would read: 

  PRIVATE CONST MAXIMUM_CSV_PARAMETERS AS Integer = 300
  #include initialise_csv_variables.include
  '
  'add more code specific to module_b


and in a file called initialise_csv_variables.include it would contain:

  PRIVATE WordMarker1 AS Integer
  :
  '200 further variable declarations and initialisations
  :
  PRIVATE sParameterNameArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
  PRIVATE sParameterValueArray AS NEW String[MAXIMUM_CSV_PARAMETERS]

The #include files can contain any amount of well trodden
proven gambas code which is maintained in only one file.

I will argue that adding C like #include functionality saves a ton of
work in mega programs which are already working well, but now
needs to be expanded even further.


Any chance of sneaking in this productivity enhancing feature? :-)


 
 
 On 9 June 2012 01:16, jm j...@martindale-electric.co.uk wrote:
 
  C like #include files for gambas?
 
  Sounds a bit harsh I know, but is it possible to add a feature
  that functions like a C #include?
 
  The logic behind is to address programs that are growing
  out of control in size. These are working megalithic programs that
  have had years of code piled on top of other code.
  The code has lost none of their lustre and needs to be
  expanded even more and that bit is being held up
  by this issue:
 
  If I break down programs into modules, then there is a huge
  overhead in passing parameters.
 
  If I break it down into classes, there is still a huge overhead
  in setting up classes and passing data around.
 
  These are programs that require hundred(s) of parameters to be
  set up if they are to pass data around to do one simple thing
  correctly.
 
  I have no problems doing it, but its boring and now becoming
  prone to mistakes in the way the parameters are being set up,
  and the order in which objects are being created.
  It is difficult to keep track of thousands of things at the
  same time.
 
  So I was thinking, it would be better to allow gambas programs
  to grow in size to reduce the number of different ways the
  objects are set up. But that is fatal, because you just can't find stuff
  quickly enough when you got tens of thousands of lines.
 
  I also program in C, and #include is a common way to
  pull in stuff from all over the place. It is a way to
  pull in mega numbers of .h and .c program files from all over the place
  and make a huge program without actually writing uneditable huge
  programs.
 
  The individual .c and .h programs make life so easy to debug
  and mix and match files as you need it by using a #include
  at the time and place you need it.
  Each of the .h and .c programs are separately maintained.
  Because there is only one .h file or one .c file,
  there is never any mistakes during duplication.
 
  If gambas supported #include, it would be possible
  to use #include to 

Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread Jussi Lahtinen
 C thrives on #include without showing signs of design problems.


Yes, I know, I wasn't talking about C, I was talking about object oriented
language, Gambas.




 Tens of thousands of external lines of code can be pulled in with
 a dozen #include statements, leaving the code completely manageable,
 readable and a lot more powerful than any other competing method.


Yes, but you use #include with libraries, not with programs that aren't
designed for that.
Or you have design problem.



For example, in module_a.module you might have

...

 and in a file called initialise_csv_variables.include it would contain:

  PRIVATE WordMarker1 AS Integer
  :
  '200 further variable declarations and initialisations
  :
  PRIVATE sParameterNameArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
  PRIVATE sParameterValueArray AS NEW String[MAXIMUM_CSV_PARAMETERS]

 The #include files can contain any amount of well trodden
 proven gambas code which is maintained in only one file.


So, basically you would add module/class called initialise_csv_variables,
and you use that module/class in modules a and b.




 I will argue that adding C like #include functionality saves a ton of
 work in mega programs which are already working well, but now
 needs to be expanded even further.


I don't understand how.
You would still need to write that initialise_csv_variables.include file,
you could as well write it as module/class.

Jussi
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread Jussi Lahtinen
Thinking more closely your problem, I think I know what you need.

You try to avoid writing *many* lines like this;
sParameterNameArray = NEW String[MAXIMUM_CSV_PARAMETERS]

That is caused by broken object design, usually because you need to use old
code which had different approach than OO.
I have had same problems.

I attached my suggestion how to implement this
(IncludeProblem-0.0.1.tar.gz).
Is it working solution?

Jussi





On 9 June 2012 16:18, Jussi Lahtinen jussi.lahti...@gmail.com wrote:


 C thrives on #include without showing signs of design problems.


 Yes, I know, I wasn't talking about C, I was talking about object oriented
 language, Gambas.




 Tens of thousands of external lines of code can be pulled in with
 a dozen #include statements, leaving the code completely manageable,
 readable and a lot more powerful than any other competing method.


 Yes, but you use #include with libraries, not with programs that aren't
 designed for that.
 Or you have design problem.



 For example, in module_a.module you might have

...


 and in a file called initialise_csv_variables.include it would contain:

  PRIVATE WordMarker1 AS Integer
  :
  '200 further variable declarations and initialisations
  :
  PRIVATE sParameterNameArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
  PRIVATE sParameterValueArray AS NEW String[MAXIMUM_CSV_PARAMETERS]

 The #include files can contain any amount of well trodden
 proven gambas code which is maintained in only one file.


 So, basically you would add module/class called initialise_csv_variables,
 and you use that module/class in modules a and b.




 I will argue that adding C like #include functionality saves a ton of
 work in mega programs which are already working well, but now
 needs to be expanded even further.


 I don't understand how.
 You would still need to write that initialise_csv_variables.include file,
 you could as well write it as module/class.

 Jussi





IncludeProblem-0.0.1.tar.gz
Description: GNU Zip compressed data
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread Bruce
On Sat, 2012-06-09 at 13:51 +0100, jm wrote:
 On Sat, 2012-06-09 at 02:45 +0300, Jussi Lahtinen wrote:
  Maybe I'm just too tired, but I don't understand the point.

Jussi, maybe I'm just too old as well as tired, but I can't grasp the
point of taking an object oriented language and trying to jam an old
(albeit well tested) non-OO concept into it.

Joe, I am having some degree of trouble really understanding your value
proposition. Especially the last post (which I have snipped in entirety,
sorry). All I can grasp from reading it several times is that you feel
that #include has some productivity value in providing what we call
inheritance and polymorphism.

I am not trying to put you down but I really can't grasp the ideas of
thousands of parameters and hundreds of initialisations.  

{ We, here at paddys-hill have tens of clients (well a few tens anyway )
that use a dozen or so applications, the code base encompasses around
two hundred or so classes and modules organized into around thirty
components and libraries.  The total code size is less than 25,000 lines
and I would guess that probably 60% or more of that is comments. At a
guess, the largest method calls would be 7 parameters, and they are
just convenience calls to a class constructor.  By far the largest
chunk of code is a library that downloads the text of around 40 web
pages a day (about 40,000 text lines), parses them, normalises them and
uploads them to the central database. I just checked and it's 6345 lines
of code, so about 2400 working lines, which are mainly involved in text
parsing (things like discerning Mac Donald and MacDonald or Miss
Jane O'Donnel and Ms Jan ODonnell are the same names). The primary
application that uses this library runs once a day and adds about 1200
rows to a central postgresql database and can update anywhere between 2
and 10,000 other rows.  It takes about 10 minutes.  The central
database has just over 3.2 million rows, the clients each have a
sub-mirrored database of who-knows-what size.}

Anyway, I hope you can see from the above {} that those numbers you are
using are fairly un-emotive to the reader.  

regards
Bruce




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread Jussi Lahtinen
Bruce, please re-read. I'm against idea of #include being new keyword.

Jussi



On 9 June 2012 17:00, Bruce bbr...@paddys-hill.net wrote:

 On Sat, 2012-06-09 at 13:51 +0100, jm wrote:
  On Sat, 2012-06-09 at 02:45 +0300, Jussi Lahtinen wrote:
   Maybe I'm just too tired, but I don't understand the point.

 Jussi, maybe I'm just too old as well as tired, but I can't grasp the
 point of taking an object oriented language and trying to jam an old
 (albeit well tested) non-OO concept into it.

 Joe, I am having some degree of trouble really understanding your value
 proposition. Especially the last post (which I have snipped in entirety,
 sorry). All I can grasp from reading it several times is that you feel
 that #include has some productivity value in providing what we call
 inheritance and polymorphism.

 I am not trying to put you down but I really can't grasp the ideas of
 thousands of parameters and hundreds of initialisations.

 { We, here at paddys-hill have tens of clients (well a few tens anyway )
 that use a dozen or so applications, the code base encompasses around
 two hundred or so classes and modules organized into around thirty
 components and libraries.  The total code size is less than 25,000 lines
 and I would guess that probably 60% or more of that is comments. At a
 guess, the largest method calls would be 7 parameters, and they are
 just convenience calls to a class constructor.  By far the largest
 chunk of code is a library that downloads the text of around 40 web
 pages a day (about 40,000 text lines), parses them, normalises them and
 uploads them to the central database. I just checked and it's 6345 lines
 of code, so about 2400 working lines, which are mainly involved in text
 parsing (things like discerning Mac Donald and MacDonald or Miss
 Jane O'Donnel and Ms Jan ODonnell are the same names). The primary
 application that uses this library runs once a day and adds about 1200
 rows to a central postgresql database and can update anywhere between 2
 and 10,000 other rows.  It takes about 10 minutes.  The central
 database has just over 3.2 million rows, the clients each have a
 sub-mirrored database of who-knows-what size.}

 Anyway, I hope you can see from the above {} that those numbers you are
 using are fairly un-emotive to the reader.

 regards
 Bruce





 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread Jussi Lahtinen
Sorry, maybe I need to re-read!

Jussi



On 9 June 2012 18:02, Jussi Lahtinen jussi.lahti...@gmail.com wrote:

 Bruce, please re-read. I'm against idea of #include being new keyword.

 Jussi




 On 9 June 2012 17:00, Bruce bbr...@paddys-hill.net wrote:

 On Sat, 2012-06-09 at 13:51 +0100, jm wrote:
  On Sat, 2012-06-09 at 02:45 +0300, Jussi Lahtinen wrote:
   Maybe I'm just too tired, but I don't understand the point.

 Jussi, maybe I'm just too old as well as tired, but I can't grasp the
 point of taking an object oriented language and trying to jam an old
 (albeit well tested) non-OO concept into it.

 Joe, I am having some degree of trouble really understanding your value
 proposition. Especially the last post (which I have snipped in entirety,
 sorry). All I can grasp from reading it several times is that you feel
 that #include has some productivity value in providing what we call
 inheritance and polymorphism.

 I am not trying to put you down but I really can't grasp the ideas of
 thousands of parameters and hundreds of initialisations.

 { We, here at paddys-hill have tens of clients (well a few tens anyway )
 that use a dozen or so applications, the code base encompasses around
 two hundred or so classes and modules organized into around thirty
 components and libraries.  The total code size is less than 25,000 lines
 and I would guess that probably 60% or more of that is comments. At a
 guess, the largest method calls would be 7 parameters, and they are
 just convenience calls to a class constructor.  By far the largest
 chunk of code is a library that downloads the text of around 40 web
 pages a day (about 40,000 text lines), parses them, normalises them and
 uploads them to the central database. I just checked and it's 6345 lines
 of code, so about 2400 working lines, which are mainly involved in text
 parsing (things like discerning Mac Donald and MacDonald or Miss
 Jane O'Donnel and Ms Jan ODonnell are the same names). The primary
 application that uses this library runs once a day and adds about 1200
 rows to a central postgresql database and can update anywhere between 2
 and 10,000 other rows.  It takes about 10 minutes.  The central
 database has just over 3.2 million rows, the clients each have a
 sub-mirrored database of who-knows-what size.}

 Anyway, I hope you can see from the above {} that those numbers you are
 using are fairly un-emotive to the reader.

 regards
 Bruce





 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-09 Thread Jussi Lahtinen
OK, while that solution might work, it sucks.
Instead see new attachment (IncludeProblem-2.0.tar.gz).

Jussi



On 9 June 2012 16:57, Jussi Lahtinen jussi.lahti...@gmail.com wrote:

 Thinking more closely your problem, I think I know what you need.

 You try to avoid writing *many* lines like this;
 sParameterNameArray = NEW String[MAXIMUM_CSV_PARAMETERS]

 That is caused by broken object design, usually because you need to use
 old code which had different approach than OO.
 I have had same problems.

 I attached my suggestion how to implement this
 (IncludeProblem-0.0.1.tar.gz).
 Is it working solution?

 Jussi






 On 9 June 2012 16:18, Jussi Lahtinen jussi.lahti...@gmail.com wrote:


 C thrives on #include without showing signs of design problems.


 Yes, I know, I wasn't talking about C, I was talking about object
 oriented language, Gambas.




 Tens of thousands of external lines of code can be pulled in with
 a dozen #include statements, leaving the code completely manageable,
 readable and a lot more powerful than any other competing method.


 Yes, but you use #include with libraries, not with programs that aren't
 designed for that.
 Or you have design problem.



 For example, in module_a.module you might have

...


 and in a file called initialise_csv_variables.include it would contain:

  PRIVATE WordMarker1 AS Integer
  :
  '200 further variable declarations and initialisations
  :
  PRIVATE sParameterNameArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
  PRIVATE sParameterValueArray AS NEW String[MAXIMUM_CSV_PARAMETERS]

 The #include files can contain any amount of well trodden
 proven gambas code which is maintained in only one file.


 So, basically you would add module/class called initialise_csv_variables,
 and you use that module/class in modules a and b.




 I will argue that adding C like #include functionality saves a ton of
 work in mega programs which are already working well, but now
 needs to be expanded even further.


 I don't understand how.
 You would still need to write that initialise_csv_variables.include file,
 you could as well write it as module/class.

 Jussi






IncludeProblem-2.0.tar.gz
Description: GNU Zip compressed data
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] C like #include for Gambas

2012-06-08 Thread Jussi Lahtinen
Maybe I'm just too tired, but I don't understand the point.

If you have huge program that needs to be expended just a little bit,
then why don't you just add new class/module/piece of code/etc which holds
that new thing to the program?

Or if you need something from the program like #include yourmodule then
just write yourmodule.whateveryouneed.

This sounds more like design problem of the code, than limitation of Gambas.

Jussi





On 9 June 2012 01:16, jm j...@martindale-electric.co.uk wrote:

 C like #include files for gambas?

 Sounds a bit harsh I know, but is it possible to add a feature
 that functions like a C #include?

 The logic behind is to address programs that are growing
 out of control in size. These are working megalithic programs that
 have had years of code piled on top of other code.
 The code has lost none of their lustre and needs to be
 expanded even more and that bit is being held up
 by this issue:

 If I break down programs into modules, then there is a huge
 overhead in passing parameters.

 If I break it down into classes, there is still a huge overhead
 in setting up classes and passing data around.

 These are programs that require hundred(s) of parameters to be
 set up if they are to pass data around to do one simple thing
 correctly.

 I have no problems doing it, but its boring and now becoming
 prone to mistakes in the way the parameters are being set up,
 and the order in which objects are being created.
 It is difficult to keep track of thousands of things at the
 same time.

 So I was thinking, it would be better to allow gambas programs
 to grow in size to reduce the number of different ways the
 objects are set up. But that is fatal, because you just can't find stuff
 quickly enough when you got tens of thousands of lines.

 I also program in C, and #include is a common way to
 pull in stuff from all over the place. It is a way to
 pull in mega numbers of .h and .c program files from all over the place
 and make a huge program without actually writing uneditable huge
 programs.

 The individual .c and .h programs make life so easy to debug
 and mix and match files as you need it by using a #include
 at the time and place you need it.
 Each of the .h and .c programs are separately maintained.
 Because there is only one .h file or one .c file,
 there is never any mistakes during duplication.

 If gambas supported #include, it would be possible
 to use #include to pull in variable declarations,
 and snippets of well trodden code as needed without having
 to copy and paste that would otherwise end up with numerous copies
 of similar code. Instead there will be just a couple
 of files that gets pulled in as needed with a #include.

 Any chance of sneaking in this productivity enhancing feature? :-)




 __
 This message has been checked for viruses and spam by Corpex using
 the ArmourPlate Anti Virus and Anti Spam Scanning Service.
 To find out more and see our email archiving service see
 http://www.armourplate.com or call Corpex on UK 0845 050 1898.


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user