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
>>
>>
>>
>

Attachment: 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

Reply via email to