Question about "Execute"

Hello,

i have a simple question, i am a little bit lost with maxscript, so, if you can help it will be so nice ;)

i think its probably really simple, my question is: Do you know an alternative to "execute" to do this stuff :

fn LogoPreset1 = ( print "logo1" ) 
fn LogoPreset2 = ( print "logo2" ) 
fn LogoPreset3 = ( print "logo3" ) 
 
rollout testrollout "test" width:272 height:120 ( 
	dropdownlist dd items:#("hello","hello world","hello you") height:6 
	button addb "add logo" pos:[50,35] width:125 height:32 
 
	fn w = 
		( 
			z = dd.selection as string 
			execute("LogoPreset"+z+"()") 
			) 
 
			on addb pressed do ( 
		w() 
		) 
 
 
		) 
 
 
createDialog testrollout

Because of "execute" i have to put fn before the rollout, but doing that complicate some other part of my main script.

so its why i'm looking for an alternative

thank you for your help.

Comments

Comment viewing options

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

...

BTW Romeh your last example is a total mess :) No hard feelings. ;)

bga

Romeh's picture

hehe, yeah that was a big

hehe, yeah that was a big mess :)

Thank you barigazy & miaou
Two different methods, seem to exist so many ways to do the same thing in maxscript...
I'll see it tomorrow, i think it will be probably ok

thanks

barigazy's picture

...

Yup. In MXS can do same things in few different ways. That's the power of this scripting languade. But only GOD knows which way is the best :)
Just keep it simple that's the basic rule.

bga

barigazy's picture

...

Hi Kostadin,
This does not apply to you :)

bga

Comment viewing options

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