May 15, 2024, 04:19:47 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


PROJECTGLOBAL

Started by LarryMc, December 27, 2008, 06:34:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

I made a stab at using the PROJECTGLOBAL keyword to see if it would work with sub declarations.

Got errors, so I assume it only works with variables; unless I missed something.

Would be nice if it handled declarations also.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Ionic Wind Support Team

The whole point of using PROJECTGLOBAL is that file is added to a project so when compiled the variables are defined global, and when $included in other files they are defined extern. 

For subroutines you basically do the same thing.  One include file with declare externs, and a source file(s) with GLOBAL SUBs .... If you wish you could use just a single include file, putting your declare extern(s) after the PROJECTGLOBAL "OFF" statement. 

I understand what you tried to do, but an implementation like that would be a little messy.  Include files shouldn't really contain code, and its hard to get the parser to ignore code and not generate anything. 

The new designer I am working on handles these details for you.  When you add a subroutine to a project it will let you declare it either local or global and puts the externs in the right place. 

Paul.
Ionic Wind Support Team