I have requested this before and got no answer. So can anyone give me the code!
Offline
johnnydean1 wrote:
I have requested this before and got no answer. So can anyone give me the code!
It's really easy! just look through the code of addGlobalVariable and adapt it to take in an argument like addGlobVar: varName! if you don't know what i'm talking about, you're not advanced enough in squeak for making a mod. but since i know you, try that... (hint: just replace the diaog code bit with result <-- varName get it?)
Offline
Yes I just couldnt find that meathod!
Offline
Thank you, using that meathod I have made a
make ( global/local ) var [ ]
Offline
this can be closed and here is my code:
make: t1 var: t2
| t3 t5 t6 |
t3 _ t2.
t5 _ self ownerThatIsA: ScratchFrameMorph.
t1 = 'global'
ifTrue:
[t3 _ t3 asUTF8.
t5 workPane addVariable: t3]
ifFalse:
[t6 _ self.
t6 addVariable: t3]
Offline