Declaration of the return typ is missed for pointers...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
IceSoft
Addict
Addict
Posts: 1683
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Declaration of the return typ is missed for pointers...

Post by IceSoft »

... on:
Procedure.<*Pointer.Structure>
Import/ImportC (Important for wrappers), etc

I get always an syntax error when I try to use it anyhow (no syntax is definied on PureBasic)

Example:

Code: Select all

Structure Cost_Model
	type.a; See the Cost_Model_type enum
	compare_fn.f
EndStructure

Procedure.i Test()
  static ret.Cost_Model 
  ret\compare_fn = 10.1
  ProcedureReturn @ret
EndProcedure


*p.Cost_Model = Test()

Debug *p\compare_fn
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Declaration of the return typ is missed for pointers...

Post by Fred »

User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Declaration of the return typ is missed for pointers...

Post by Danilo »

Another way, for your documentation purposes (you generate docs from PB codes?):

Code: Select all

Macro ProcedurePtr(name)    :Procedure.i    :EndMacro
Macro ProcedurePtrC(name)   :ProcedureC.i   :EndMacro
Macro ProcedurePtrDLL(name) :ProcedureDLL.i :EndMacro
Macro ProcedurePtrCDLL(name):ProcedureCDLL.i:EndMacro

Structure Cost_Model
   type.a; See the Cost_Model_type enum
   compare_fn.f
EndStructure

ProcedurePtr(Cost_Model) Test()
  Static ret.Cost_Model 
  ret\compare_fn = 10.1
  ProcedureReturn @ret
EndProcedure


*p.Cost_Model = Test()

Debug *p\compare_fn

Code: Select all

Macro RetPtr(name):i:EndMacro

Structure Cost_Model
   type.a; See the Cost_Model_type enum
   compare_fn.f
EndStructure

Procedure.RetPtr(Cost_Model) Test()
  Static ret.Cost_Model 
  ret\compare_fn = 10.1
  ProcedureReturn @ret
EndProcedure


*p.Cost_Model = Test()

Debug *p\compare_fn

Code: Select all

Structure Cost_Model
   type.a; See the Cost_Model_type enum
   compare_fn.f
EndStructure
Macro pCost_Model:i:EndMacro

Procedure.pCost_Model Test()
  Static ret.Cost_Model 
  ret\compare_fn = 10.1
  ProcedureReturn @ret
EndProcedure


*p.Cost_Model = Test()

Debug *p\compare_fn
User avatar
IceSoft
Addict
Addict
Posts: 1683
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Declaration of the return typ is missed for pointers...

Post by IceSoft »

@Danilo,
Ok nice ideas.

But a internal/nativ syntax check will be better.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
IceSoft
Addict
Addict
Posts: 1683
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Declaration of the return typ is missed for pointers...

Post by IceSoft »

@Fred,
Will it get a chance to add this feature to the next Beta?
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Declaration of the return typ is missed for pointers...

Post by freak »

No.
quidquid Latine dictum sit altum videtur
Post Reply