Re: Need Help Creating include files.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Martin Berger wrote:
> 
> Hi all,
> 
> I need to know what I am doing wrong here:
> 
> I created an include file called var.e with the following type definitions.
> 
> -- var.e include file
> -- Custom type definitions
> 
> 
> type POSITIVE(atom x)
>     return x >= 0
> end type
> 
> type NEGATIVE(atom x)
>     return x < 0
> end type

These need to be declared as global if you want to use them outside of
the file in which they are declared.

global type POSITIVE(atom x)
    return x >= 0
end type
 
global type NEGATIVE(atom x)
    return x < 0
end type


A type has scope just like a function, and can be called just like a 
regular function.

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu