Page 1 of 1

@uidialog

Posted: Mon Jan 04, 2010 2:09 pm
by tchaithonov
Hi Guys, how's your new year so far?

I have a question about @uidialog - if I want to write a statement that contains a loop, how should I do it?

Code: Select all

for !i = 1 to 3 %val = @str(!i) %test = %test + "," + "Text" + "," + %val next @uidialog("Caption", %cap_name, %test)
(I know the code's not working.) Ultimately I want the dialog box to use radio buttons instead of text, but as a test, I bet it's safer to start with something simple (yet it's still not working). Any thoughts? Please let me know. Thanks.

Tchaithonov

Re: @uidialog

Posted: Mon Jan 04, 2010 6:43 pm
by EViews Gareth
There's a few thing wrong with what you've got. First of all with the way you're building up your string, you have an errant comma at the start. Secondly you need to enclose both the control type, and the text to be used in quotes. Finally you need to put braces around your string variable inside the @uidialog command:

Code: Select all

for !i=1 to 3 %val = @str(!i) %test = %test + "," + """Text""" + "," + """" + %val + """" next %test2 = @mid(%test,2) @uidialog("caption",%cap_name,{%test2})

Re: @uidialog

Posted: Tue Jan 05, 2010 9:55 am
by tchaithonov
Thanks Gareth. I committed some stupid mistakes, and thanks for pointing that out.. I will be more careful next time around.