PureBasic Forum
https://www.purebasic.fr/english/

[Done]Problem with static and PB 520 beta 5/6
https://www.purebasic.fr/english/viewtopic.php?f=26&t=55425
Page 1 of 1

Author:  mpz [ Sat Jul 13, 2013 5:41 pm ]
Post subject:  [Done]Problem with static and PB 520 beta 5/6

Hello,

i found a problem with the function static and PB 5.20 Windows. In the procedure the static variabe is not set to "extrn". I hope you find a solution:

Code:
ProcedureDLL  Mytest (Var)
 
  Static *pointer
 
  If Not *pointer
    *pointer = 10
  EndIf
  ProcedureReturn var + *pointer
EndProcedure


error undefinite_symbol

as code

Code:
format MS COFF

Public PB_Mytest

section '.text' code readable executable

PB_Mytest:
PUSH   ebx
PS0=8
;
; Static *pointer
;
; If Not *pointer
CMP    dword [so_Mytest.p_pointer],0  <- error



it is missing

Code:
extrn so_Mytest.p_pointer


i hope this helps to solve the problem...

Greeting Michael

Author:  Bisonte [ Sun Jul 14, 2013 8:16 pm ]
Post subject:  Re: Problem with static and PB 520 beta 5

The helpfile of tailbite :

Quote:
Note on using STATIC keyword : The static keyword is not supported by tailbite. (The generated PureBasicStart routine is not evaluated.)
Please use a Global variable instead and initialize it in the Init function.

Author:  mpz [ Sun Jul 14, 2013 9:36 pm ]
Post subject:  Re: Problem with static and PB 520 beta 5

Hi Bisonte,

i use static since 3 years with tailbite and PB and it woks fine. I think it is only a little think for changing. If it is not possible i will test it with global...

Greetings Michael

Author:  ABBKlaus [ Mon Jul 15, 2013 5:13 pm ]
Post subject:  Re: Problem with static and PB 520 beta 5

Know issues wrote:
- The use of the Static keyword is limited to basic types : Byte,Word,Long,Integer,Quad,Double
You can´t use Strings / Dim() as they allocate memory in a different place of code that TailBite is not parsing

It was totally legal until PB5.20 came out :twisted:

I´ll try to fix it :shock:

Author:  ABBKlaus [ Mon Jul 15, 2013 6:46 pm ]
Post subject:  Re: Problem with static and PB 520 beta 5

I found out that static objects got renamed to "so_" in older Versions it was "s_". I added it to the List of VarAliases in TailBite_Res.pb.

It might not be the last Change to be found.

Here´s the download : http://www.tailbite.com/downloads/TailBiteV1.4.10.zip

BR Klaus

Author:  mpz [ Tue Jul 16, 2013 1:39 pm ]
Post subject:  Re: Problem with static and PB 520 beta 5

Hello ABBKlaus,

i tested it with Windows XP, my (monster) code and PB 5.20 Beta 5 and it works fine. Tomorrow i will test it with Windows 7 and PB 5.2 x86 and x64...

*P.S.: tested with Windows 7 x86 and x64, works fine

Much thanks
Michael

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/