ScriptSpot

Forum topic · General Scripting

How can I define a variable inside my rollout?

By Juzwa · 2014-10-30

Description

Hi,

Can I define a variable inside a rollout?

I want my edittext deafault text store as a variable.

This is piece of my code:


try(destroyDialog PI_JobSubmissionTool)catch()

rollout PI_JobSubmissionTool "PI_JobSubmissionTool" width:350 height:160
(
edittext _defJobName "Job Name:" width:300 height:20 pos:[10,50] text:"enter job name here..."
oldString = _defJobName.text
)
createdialog PI_JobSubmissionTool

Comments (1)

.

miauu · 2014-10-31

use the word LOCAL


try(destroyDialog PI_JobSubmissionTool)catch()
 
rollout PI_JobSubmissionTool "PI_JobSubmissionTool" width:350 height:160
(
local etVal = "enter job name here..."
	edittext _defJobName "Job Name:" width:300 height:20 pos:[10,50] text:"enter job name here..."
	local oldString = _defJobName.text
) 
createdialog PI_JobSubmissionTool