ScriptSpot

Forum topic · General Scripting

Variable in a move function

By remykonings · 2019-01-20

Description

Hello,

I'm learning a bit on variables. Can somebody tell me what is going wrong here?
I like to have a variable to adjust the height for a move function.

Thank you.

--
Rollout test "testing"
(
button updown "UpDown" tooltip:"Move the selected object up" width:90 across:3
spinner amount "Amount " type:#integer range:[-1000,1000,300]

on updown pressed do
i = amount.value
move $ [0,0,i]
)
createDialog test width:300

i've been trying with some of the examples of https://vimeo.com/album/1514565

Comments (2)

paparalla · 2019-09-20

Just add parenthesis like this:

Rollout test "testing"
(
button updown "UpDown" tooltip:"Move the selected object up" width:90 across:3
spinner amount "Amount " type:#integer range:[-1000,1000,300]

on updown pressed do (---here

i = amount.value
move $ [0,0,i]

)---and here
)
createDialog test width:300

*

remykonings · 2019-01-20

Just got it.