Got an idea for enhancing PureBasic? New command(s) you'd like to see?
remi_meier
Enthusiast
Posts: 468 Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland
Post
by remi_meier » Thu Oct 06, 2005 12:25 pm
I would like to see something like
Code: Select all
Declare.l test(a.l)
test() = IsFunction(0, "spk")
test(4)
and
CDeclare.l test(a.l)
test() = IsFunction(0, "spk")
test(4)
or
*test = IsFunction(0, "spk")
*test(4)
in PB.
CallFunctionFast has some disadvantages:
- needs some more time
- long name
- not as readable as my requests
- needs a wrapper function again for floats and better readability
Athlon64 3700+, 1024MB Ram, Radeon X1600
Fred
Administrator
Posts: 18162 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Thu Oct 06, 2005 5:10 pm
True, this is will added in v4 (and CallFunction/CallFunctionFast will be probably removed).
Polo
Addict
Posts: 2422 Joined: Tue May 06, 2003 5:07 pm
Location: UK
Post
by Polo » Thu Oct 06, 2005 5:31 pm
REALLY good news !!
MrMat
Enthusiast
Posts: 762 Joined: Sun Sep 05, 2004 6:27 am
Location: England
Post
by MrMat » Thu Oct 06, 2005 6:09 pm
Fred wrote: True, this is will added in v4 (and CallFunction/CallFunctionFast will be probably removed).
This is a contrived example, but i just want to check that it will still be possible (if CallFunctionFast gets removed):
Code: Select all
Procedure A()
Debug("A")
EndProcedure
Procedure B(p.l)
Debug("B" + Str(p))
EndProcedure
Dim addr(10)
For m = 0 To 10
If m < 5
addr(m) = @A()
Else
addr(m) = @B()
EndIf
Next
For m = 0 To 10
If m < 5
CallFunctionFast(addr(m))
Else
CallFunctionFast(addr(m), m)
EndIf
Next
So please reassure me
Mat
Fred
Administrator
Posts: 18162 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Thu Oct 06, 2005 6:54 pm
replace addr(m) with 'test' and it will work. It's just a pointer where you can put any value in..
remi_meier
Enthusiast
Posts: 468 Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland
Post
by remi_meier » Thu Oct 06, 2005 7:08 pm
Thanx a lot Fred!
Athlon64 3700+, 1024MB Ram, Radeon X1600
MrMat
Enthusiast
Posts: 762 Joined: Sun Sep 05, 2004 6:27 am
Location: England
Post
by MrMat » Thu Oct 06, 2005 7:12 pm
Thanks Fred and thanks for your IRC explanation. All seems good!
Mat