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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...