Jump to content

Help with Kommander


Recommended Posts

Hi!

 

I'm trying to do a switch or if inside a foreach but kommander is not accepting this. :wall:

Someone knows how to do that?

 

Here is a little script where I try this. If someone can help me solve this, I'll apreciate.

 

Please, copy and paste this and see what is happen.

There is a solution?

 

teste.kmdr:

<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>Form1</class>
<widget class="Dialog">
<property name="name">
	<cstring>Form1</cstring>
</property>
<property name="geometry">
	<rect>
		<x>0</x>
		<y>0</y>
		<width>235</width>
		<height>96</height>
	</rect>
</property>
<property name="caption">
	<string>Form1</string>
</property>
<widget class="ListBox">
	<item>
		<property name="text">
			<string>Item1</string>
		</property>
	</item>
	<item>
		<property name="text">
			<string>Item2</string>
		</property>
	</item>
	<item>
		<property name="text">
			<string>Item3</string>
		</property>
	</item>
	<property name="name">
		<cstring>ListBox</cstring>
	</property>
	<property name="geometry">
		<rect>
			<x>20</x>
			<y>10</y>
			<width>104</width>
			<height>70</height>
		</rect>
	</property>
</widget>
<widget class="ExecButton">
	<property name="name">
		<cstring>ExecButton</cstring>
	</property>
	<property name="geometry">
		<rect>
			<x>150</x>
			<y>30</y>
			<width>56</width>
			<height>30</height>
		</rect>
	</property>
	<property name="text">
		<string>&Ok</string>
	</property>
	<property name="associations" stdset="0">
		<stringlist>
			<string>@forEach(val, @ListBox.text)
@Message.info(@val)

@switch(@val)
 @case(Item2)
  @Message.info(eh 2)
@end

@endif</string>
		</stringlist>
	</property>
</widget>
</widget>
<layoutdefaults spacing="6" margin="11"/>
</UI>

 

Thanks 4 n F1!

Edited by ethraza
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...