How to have string as a prototype type?

Just starting out? Need help? Post your questions and find answers here.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

How to have string as a prototype type?

Post by Shannara »

For some reason, prototypes do not work if they are of a string type. However, regular callfunction(fast) works. Have anybody else experience the same?
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

23 views and no replies, must be a bug. Reported in bug section ...
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Code: Select all

Prototype.s ProtoA()
Procedure.s A()
  ProcedureReturn "Works!"
EndProcedure

PtrA.ProtoA = @A()
Debug PtrA()
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

It works from the main program, but I assumed he meant calling a function from a dll, where you still have to use PeekS() to get at a returned string. The prototype will successfully get floats, etc. from dlls but not strings.
BERESHEIT
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Answer to using strings in prototypes from DLLs @ http://www.purebasic.fr/english/viewtopic.php?t=23161 :) Thanks guys.
Post Reply