Hi Przemek,

Many thanks - that fixed it, I am getting somewhere now! I have used -n in
the past but never realized the effect on code outside the first function. I
have never used STATICS myself - I always used PUBLICS and straight
structured functional coding! That, I can understand.
I do have the original Nantucket Clipper 5.00 Manual, so I will keep
reading.
Thanks again,
Cheers,
Barry


Przemyslaw Czerpak-2 wrote:
> 
> On Fri, 28 Nov 2008, Barry Jackson wrote:
> 
> Hi Barry,
> 
>> More problems.
>> There is a "THREAD STATIC s_aPorts"  declaration before the main
>> procedure
>> in telepathy.prg and no matter how I build this it always crashes with: 
>> Error BASE/1003 Variable does not exist: S_APORTS. Even if I put altd()
>> before any other functions in main() it crashes first.
>> I have tried changing it to a PUBLIC inside main(). I have tried it
>> without
>> the 'THREAD', I have compiled it with -mt but all produce the same
>> result. I
>> cannot find any documentation on Harbour variable declarations and
>> scoping
>> anywhere. Even a small test program with a STATIC declared before the
>> main()
>> procedure cannot see the static variable within the program. As I
>> understand
>> it a STATIC declared outside the main procedure should have application
>> wide
>> scope - is this correct?
> 
> The variable scope is exactly the same as in Clipper and I think also
> in xbase++ if it's Clipper compatible. See what -n harbour and Clipper
> compiler switch does in Clipper documentation and use it to compiler
> your code. All Clipper switches are supported. -n means that compiler
> will not generate automatically procedure with the same name as compiled
> file which will contain code between start of file and first explicitly
> defined user function/procedure.
> When it's used then before 1-st function/procedure you can only use
> declarations like MEMVAR, FIELD, [THREAD] STATIC and they have file
> wide scope.
> 
> best regards,
> Przemek
> _______________________________________________
> Harbour mailing list
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-building-telepathy-test-program-tp20707046p20745967.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to