Notifications
Clear all

[Closed] save Names to Maxfile – help please

It is always showing up undefined…?


try(destroyDialog ::rlNewJobName)catch()
rollout rlNewJobName "New Job Name"
(
	local data_ch = 2000
	local data_jL = 2001
	local jobNames = #()
	local jobLocation = ""
	
	edittext etNewJobName "New:" fieldwidth:150 top:true pos:[10,10]
	listbox lbJobNames "" items:#() width:179 height:6 pos:[10,34]
	edittext etLocation "Location: " fieldwidth:128 top:true pos:[10,120]
	
	on etNewJobName entered txt do --//Job Names
	(
		appendIfUnique jobNames txt
		lbJobNames.items = jobNames
		etNewJobName.text = ""
	)
	
	on etLocation entered txt do --//Save Location
	(
		etLocation.text = jobLocation = txt
	)
	
	on lbJobNames doubleClicked itm do 
	(
		temp = lbJobNames.items 
		deleteItem temp itm
		lbJobNames.items = temp 
	)
	
	on rlNewJobName close do
	(
		setappdata rootnode data_ch (with printallelements on jobNames as string)
		setappdata rootnode data_jL (jobLocation as string)
	)
	
	on rlNewJobName open do
	(
		jobNames = try (execute (getappdata rootnode data_ch)) catch(#())
			
		local path = getappdata rootnode data_jL	
		if path == undefined or not doesfileexist path do path = ""
			
		etLocation.text = jobLocation as string
		lbJobNames.items = 	jobNames
	)
)
createDialog rlNewJobName 200 160

you didn’t set jobLocation variable.

You know what,
I was just randomly typing text in to test it out not realizing there was a test for doesFileExist.

Thanks denisT for the help once again!

Page 2 / 2