@uidialog

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

@uidialog

Postby tchaithonov » Mon Jan 04, 2010 2:09 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: @uidialog

Postby EViews Gareth » Mon Jan 04, 2010 6:43 pm

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})

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: @uidialog

Postby tchaithonov » Tue Jan 05, 2010 9:55 am

Thanks Gareth. I committed some stupid mistakes, and thanks for pointing that out.. I will be more careful next time around.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest