View previous topic :: View next topic |
Author |
Message |
moechofe
Joined: 07 Oct 2006 Posts: 25 Location: Paris, France
|
Posted: Sun Feb 28, 2010 9:59 am Post subject: [FIXED] How to get a global value in D |
|
|
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 |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Sun Feb 28, 2010 1:55 pm Post subject: |
|
|
From the D side? Use minid.ex.lookup. |
|
Back to top |
|
|
moechofe
Joined: 07 Oct 2006 Posts: 25 Location: Paris, France
|
Posted: Fri Mar 19, 2010 3:48 pm Post subject: |
|
|
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 |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Tue Mar 23, 2010 3:57 pm Post subject: |
|
|
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 |
|
|
moechofe
Joined: 07 Oct 2006 Posts: 25 Location: Paris, France
|
Posted: Wed Mar 24, 2010 3:02 pm Post subject: |
|
|
Oups,
Tanks you, I completly forgot that. |
|
Back to top |
|
|
|