[Gambas-devel] conditional compilation

chintan rao chintanraoh at ...176...
Sat Oct 7 03:51:43 CEST 2006


Hi,
>>From:Chintan
>> #IF <classname>
>> It means that if there exists by that name (classname) the code will be
>> compiled for that class.
>> I dont know weather this feature will be usefull.

>From:Benoit Minisini
>The compiler can't know which classes "exist", as they are discovered when
the
>interpreter loads classes.

>The compiler just knows that some identifiers are classes with the
components
>needed by the project (he looks inside *.list files), and with the classes
>defined in the project.

>So I don't really see the need of this. Give me a concrete example, maybe I
>will understand what you are in mind.

>Regards,

For eample one has 2 classes class1 and class2 both for the same purpose
(for example to fill a form). I add  the following piece of code to my
gambas
source code.

#IF class1.class
<code for class one>
#ENDIF

#IF class2.class
<code form class two>
#ENDIF

One can present code to some else without making changes
to the prpject just by removing one of the classes from the project folder.
The same code
can be used for two different purposes.

Yours sincerely,
Chintan Rao H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20061007/c6945f94/attachment.html>


More information about the Devel mailing list