warning and continue dialog problem (and more)

Hello,i got (another) problem with my script

if ((ssRoll != undefined) and (ssRoll.isdisplayed)) do (destroyDialog ssRoll)
 
Rollout ssRoll "GearCreator V0.3" (
	group ""(
		spinner sp_w "width" type:#float range:[0.0,10,1]
		spinner sp_h "height" type:#float range:[0.0,10,1]
		button bt_create "Create Gear"
	)
 
	on bt_create pressed do( 
 
		BPs = sp_w.value *sp_h.value
 
		if BPs < 0.999 then (
			rollout bgaRoll "GearCreator Warning" 
				(
					label lbl_1 "WARNING:"
					label lbl_2  "Blablabla"
					label lbl_3  BPs as string
					button bt_back "go back" width:82 height:24 align:#left offset:[2,10]
					button bt_forw "make anyway" width:82 height:24 align:#left offset:[92,-29]
					on bt_back pressed do(destroyDialog bgaRoll)
					on bt_forw pressed do (jump to line 29) and (destroyDialog bgaRoll)    
				)
			createDialog bgaRoll 200 116
			) 
			else 
				(
				ss = rectangle name:"example" width:(sp_w.value) length:(sp_h.value)
				)	
 
	) --end create pressed
) --end rollout
 
createDialog ssRoll

q1- the 'on bt_forw pressed do' is wrong, but how do i continue anyway?

q2- the "BPs as string" is undefined. In my full script i use BPs a lott. should i write it easy time within the brackets, or is there another way?

tnx

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

(
	if ((ssRoll != undefined) and (ssRoll.isdisplayed)) do (destroyDialog ssRoll)
	global ssRoll
	Rollout ssRoll "GearCreator V0.3" 
	(
		local BPs = 0
		group ""
		(
			spinner sp_w "width" type:#float range:[0.0,10,1]
			spinner sp_h "height" type:#float range:[0.0,10,1]
			button bt_create "Create Gear"
		)
 
		function CreateRectangle =
		(
			ss = rectangle name:"example" width:(sp_w.value) length:(sp_h.value)
		)
 
		on bt_create pressed do
		( 
			BPs = sp_w.value *sp_h.value
 
			if BPs < 0.999 then 
			(
				rollout bgaRoll "GearCreator Warning" 
				(
					local lbl_3_text = ""
					label lbl_1 "WARNING:"
					label lbl_2  "Blablabla"
					label lbl_3 lbl_3_text
					button bt_back "go back" width:82 height:24 align:#left offset:[2,10]
					button bt_forw "make anyway" width:82 height:24 align:#left offset:[92,-29]
					on bt_back pressed do(destroyDialog bgaRoll)
					on bt_forw pressed do
					(
						ssRoll.CreateRectangle()
						destroyDialog bgaRoll
					)
 
					on bgaRoll open do
					(
						lbl_3.text =  (ssRoll.BPs as string)
					)
				)
				createDialog bgaRoll 200 116
			) 
			else 
			(
				CreateRectangle()
			)	
 
		) --end create pressed
	) --end rollout
 
	createDialog ssRoll
)
Ralf's picture

.

Ah,thank you again, Miauu. You are great.
(and you have enpasant another problem solved. I get confused with local/global a lott)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.