addin

For questions regarding programming in the EViews programming language.

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

amrsherif
Posts: 99
Joined: Mon Jul 23, 2018 4:34 pm

addin

Postby amrsherif » Mon May 30, 2022 7:45 am

Hi,

I am writing an addin and would like to grab the input from users. Typically i loop through each input word like so:

------
string input=""
for %num 0 1 2 3 4 5 6 7 8 9 10
if %{%num}<>"" then
input=input+%{%num}+" "
endif
next

input=@ltrim(input)
input=@rtrim(input)
------

However, in this case, i would like to grab all the text within quotes. The number of words inside the quotes is unknown.
for example: fetch(d=db) "series1 data_type" "series2 data_type1 data_type2"

Is there a way to use the quotes as a delimiter in this case?

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

Re: addin

Postby EViews Gareth » Mon May 30, 2022 3:22 pm

I don’t follow. But perhaps @word does what you want.
Follow us on Twitter @IHSEViews

amrsherif
Posts: 99
Joined: Mon Jul 23, 2018 4:34 pm

Re: addin

Postby amrsherif » Tue May 31, 2022 12:36 pm

in this example:

fetch(d=db) "series1 data_type" "series2 data_type1 data_type2"

I am looking for a way to take the red text as the first user input "series1 data_type", and the blue text as the second "series2 data_type1 data_type2".
In other words, everything between the quotes as one input.

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

Re: addin

Postby EViews Gareth » Tue May 31, 2022 1:22 pm

@word
Follow us on Twitter @IHSEViews

amrsherif
Posts: 99
Joined: Mon Jul 23, 2018 4:34 pm

Re: addin

Postby amrsherif » Tue May 31, 2022 1:37 pm

That works. Thanks


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 42 guests