Question about concatenating strings

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator

mjavid
Posts: 2
Joined: Tue Nov 17, 2015 6:54 am

Question about concatenating strings

Postby mjavid » Wed Apr 25, 2018 8:49 am

Hello,

When a user runs the code below in EViews 10 and enters 0209 when asked by the dialog box, the first two prompts show the expected messages (02: and :02, respectively). The next final two prompts, however, both show "a" as the message, when the expected messages are "a:" and ":a"

@uidialog("edit", %mmyyfirst, "Enter 0209",4)

@uiprompt(@left(%mmyyfirst,2)+":")
@uiprompt(":"+@left(%mmyyfirst,2))

@uiprompt(@left(%mmmyyfirst,2)+"a")
@uiprompt("a"+@left(%mmmyyfirst,2))

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

Re: Question about concatenating strings

Postby EViews Gareth » Wed Apr 25, 2018 8:56 am

I don't understand why you would think they would be "a:".

The final set of prompts are using the undefined %mmmyyfirst. Perhaps that is a typo and it should be %mmyyfirst, but even then the result would not be "a:"
Follow us on Twitter @IHSEViews

mjavid
Posts: 2
Joined: Tue Nov 17, 2015 6:54 am

Re: Question about concatenating strings

Postby mjavid » Wed Apr 25, 2018 9:23 am

My mistake, I meant to write "02a" and "a02", not "a:" and ":a".

"%mmmyyfirst" is a typo and it explains why my program wasn't working. Silly error on my part. Thanks for your help!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 3 guests