Re: [Harbour] STATIC variables in HRB and PCODE DLL

2009-11-12 Thread Adam Lubszczyk
Viktor Szakáts wrote: > > Why not add an explicit init function to reinit that > variable whenever you need it? > OK I may add extra init function (And MUST remember write it), but why, if it already exists function HB_FUNC_INITSTATICS(). The problem is that it is invoked only once. That beha

Re: [Harbour] STATIC variables in HRB and PCODE DLL

2009-11-12 Thread Viktor Szakáts
Why not add an explicit init function to reinit that variable whenever you need it? IMO it's not the job of HRB engine to solve such programming tasks. Such setting has not much point anyway as you may have multiple STATIC vars with different init requirement inside on .hrb. Moreover it makes

[Harbour] STATIC variables in HRB and PCODE DLL

2009-11-12 Thread Adam Lubszczyk
Hi! Sample code: ** hrbcode.prg (or PCODE dll) * FUNCTION abc() STATIC x:=99 ++x RETURN x *** main.prg ** PROCEDURE main() LOCAL i,h FOR i:=1 TO 3 h:=HB_HRBLOAD("hrbcode.hrb") ?? &("abc()") ?? &("abc()") HB_HRBUNLOAD(h) NEXT Show: 100 101 1