FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[FIXED] How to get a global value in D

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
moechofe



Joined: 07 Oct 2006
Posts: 25
Location: Paris, France

PostPosted: Sun Feb 28, 2010 9:59 am    Post subject: [FIXED] How to get a global value in D Reply with quote

Hi again,

I try to get a global var defined in MiniD to check the value.
I found "findGlobal()" but I don't know how to use it.


Last edited by moechofe on Fri Mar 19, 2010 4:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Sun Feb 28, 2010 1:55 pm    Post subject: Reply with quote

From the D side? Use minid.ex.lookup.
Back to top
View user's profile Send private message
moechofe



Joined: 07 Oct 2006
Posts: 25
Location: Paris, France

PostPosted: Fri Mar 19, 2010 3:48 pm    Post subject: Reply with quote

Yes, from the D side.

I want to use it in my unittest.
After putting the lookup value in the Stack, how can I get it from D side?

----

Ok, I think I'm begin to understand miniD. I found it:
Code:
myInt = getInt(t, lookup(t, name))
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Tue Mar 23, 2010 3:57 pm    Post subject: Reply with quote

Ghghghgh, dsource keeps logging me out, so I can't tell if there are new messages. Sorry I missed your reply X(

Yes, you use getXxx to get a value off the MiniD stack, but it's good practice to leave the stack balanced. So, be sure to pop(t) after looking up a value:

Code:
myInt = getInt(t, lookup(t, name)); // stack is one slot bigger
pop(t); // stack is original size
Back to top
View user's profile Send private message
moechofe



Joined: 07 Oct 2006
Posts: 25
Location: Paris, France

PostPosted: Wed Mar 24, 2010 3:02 pm    Post subject: Reply with quote

Oups,

Tanks you, I completly forgot that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group