Page 1 of 1

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

Posted: Wed Aug 06, 2014 2:42 pm
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

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

Posted: Wed Aug 06, 2014 3:06 pm
by Fred

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

Posted: Thu Aug 07, 2014 8:30 am
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

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

Posted: Fri Sep 05, 2014 1:02 pm
by IceSoft
@Danilo,
Ok nice ideas.

But a internal/nativ syntax check will be better.

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

Posted: Wed Aug 05, 2015 8:55 am
by IceSoft
@Fred,
Will it get a chance to add this feature to the next Beta?

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

Posted: Wed Aug 05, 2015 8:49 pm
by freak
No.