YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

What order should items be in to call a class method?
jeremy_c
#1 Posted : Thursday, January 05, 2012 8:05:00 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/1/2012(UTC)
Posts: 7

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
I have a class function: Date.set_totalseconds(integer).

I have on the stack:

Code:
-1 = "set_totalseconds" native closure
-2 = Date instance I wish to operate on
-3 = Date class (I used to create a new instance of)
-4 = Root Table (used to lookup the Date class)


I then do:

Code:
sq_pushroottable
sq_pushinteger 0
sq_call 3, SQFalse, SQFalse


This call always fails. I've tried pushing the date instance after my root table and calling with 4 as well:

Code:
sq_pushroottable
sq_push -3
sq_pushinteger 0
sq_call 4, SQFalse, SQFalse


with no luck. Also:

Code:
sq_pushroottable
sq_pushinteger 0
sq_push -4
sq_call 4, SQFalse, SQFalse


Any thoughts on what I am doing wrong here?

Jeremy
fagiano
#2 Posted : Monday, January 09, 2012 3:36:33 PM(UTC)
Rank: Advanced Member

Groups: Registered, Administrators
Joined: 6/11/2005(UTC)
Posts: 827

Thanks: 0 times
Was thanked: 36 time(s) in 29 post(s)
pseudo code

push closure
push instance (this)
push param (integer)
call 2, SQFalse, SQFalse

Alberto
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.070 seconds.