can you adapt it to 1 thing please:
my variables are like:
List001
List002
can you make it to exclude them all please!
Offline
Here a slight thing:
hookupSensorNames
| t1 t2 t3 t4 t5 |
t5 _ 'distance'.
t1 _ #('slider' 'light' 'sound' 'resistance' ).
t1 _ t1 , #('-' 'tilt' 'distance' ).
(t2 _ self ownerThatIsA: ScratchStageMorph) ifNotNil: [t2 scratchServer
ifNotNil:
[t3 _ t2 scratchServer sensorNames.
t3 size > 0 ifTrue: [^ t1 , {'-'} , t2 scratchServer sensorNames]]].
t4 _ 1.
t1 size
timesRepeat:
[(t1 at: t4)
= t5 ifTrue: [t1 at: t4 put: '-'].
t4 _ t4 + 1].
^ t1Offline
hookupSensorNames
| t1 t2 t3 t4 |
t1 _ #('slider' 'light' 'sound' 'resistance' ).
t1 _ t1 , #('-' 'tilt' 'distance' ).
(t2 _ self ownerThatIsA: ScratchStageMorph) ifNotNil: [t2 scratchServer
ifNotNil:
[t3 _ t2 scratchServer sensorNames.
t3 size > 0 ifTrue: [t1 _ t1 , {'-'} , t2 scratchServer sensorNames]]].
t4 _ 1.
t1 size
timesRepeat:
[((t1 at: t4) findSubStr: 'distance') > 0 ifTrue: [t1 at: t4 put: '-'].
t4 _ t4 + 1].
^ t1
it should work with mesh now.
it was just a little tweak.
tell me if it does
Last edited by LS97 (2010-08-05 11:45:28)
Offline
johnnydean1 wrote:
does this do the 000 001 002 thing
it should, but that code was from memory, so i mightve got somethng wrong.
tomorrow i'll post the mesh version
Offline
edited my last post with code (reply number 29, this is #33).
use that code, it should work now.
Offline
Dont worry fixed, and I need 1 more thing wheres the code that shows the variables, so if I had variables
Hi
Hello
In the variables tab I have
(Hi)
(Hello)
Wheres the code?
And..
Wheres the code for the make list button?
Last edited by johnnydean1 (2010-08-06 06:04:05)
Offline
i'm not sure about what you're looking for. if you want to know what method creates the buttons, find it in ScriptableScratch > blocks > variablesPage. if you wan't to know what the code for creating a list look in ScriptableScratch > lists > addGlobalList
Offline
Ok Im looking for the list of variables under the variables tab.
Offline
it should be under 'variablespage'
Offline
I found it, but I need to mod its in the same way, to not show variables with List in them. How?
Offline
never looked at its code tbh.
let me see...
it's in addVariableReportersTo:x:y: actually.
try setting a new var to varNames and excluding ones named 'list'
Last edited by LS97 (2010-08-07 13:06:28)
Offline
it's pretty hard. i tried, but i'm not sure how to remove an item from an array. sorry.
Offline