Just starting out? Need help? Post your questions and find answers here.
Konne
Enthusiast
Posts: 434 Joined: Thu May 12, 2005 9:15 pm
Post
by Konne » Wed Aug 02, 2006 12:21 pm
How can I call a List of Prototypes?
If there is any Logic it should work like that:
Code: Select all
Prototype Proc()
NewList Test.Proc()
Procedure Proce()
ProcedureReturn 5
EndProcedure
AddElement(Test())
Test()=@Proce()
Debug Test()() ;Compiler problem!
But it doesn't
Apart from that Mrs Lincoln, how was the show?
Fred
Administrator
Posts: 18162 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Sun Oct 29, 2006 8:19 pm
Prototypes can't be used with list or array, because it leads to wierd syntax (a compiler check has been added). If you need that, you can still create a structure and put the prototype in it, it's exactly the same code generated wise.
Psychophanta
Always Here
Posts: 5153 Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:
Post
by Psychophanta » Mon Oct 30, 2006 11:50 am
Test()()
... mhh... not so wierd
Simply it should mean a prototype used with list or array, IMHO
Fred
Administrator
Posts: 18162 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Mon Oct 30, 2006 8:21 pm
It is wierd
.
Trond
Always Here
Posts: 7446 Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway
Post
by Trond » Mon Oct 30, 2006 9:10 pm
Konne
Enthusiast
Posts: 434 Joined: Thu May 12, 2005 9:15 pm
Post
by Konne » Wed Nov 08, 2006 6:13 pm
It's not weird it's common sense. So it should work. I mean if you don't like it don't do it. Everything else would be a waste of resources and writing.
Apart from that Mrs Lincoln, how was the show?
Rescator
Addict
Posts: 1769 Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway
Post
by Rescator » Fri Oct 05, 2007 6:04 am
It kinda looks weird yeah. I never really liked lists and arrays using () in the first place, looks too much like a procedure or function to me.
*wonders why Fred didn't use [] for lists and arrays instead*
Fred
Administrator
Posts: 18162 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Fri Oct 05, 2007 9:12 am
Rescator wrote: *wonders why Fred didn't use [] for lists and arrays instead*
BASIC
Kaeru Gaman
Addict
Posts: 4826 Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany
Post
by Kaeru Gaman » Fri Oct 05, 2007 12:55 pm
Konne wrote: It's not weird it's common sense. So it should work.
that's a good joke
oh... and have a nice day.
DoubleDutch
Addict
Posts: 3220 Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:
Post
by DoubleDutch » Fri Oct 05, 2007 1:31 pm
BASIC
Good point. But maybe Rescator has a point too about the [], unless you have other plans for them?