Page 1 of 1

breaking lines of code with " _ " in program not working

Posted: Thu Feb 20, 2020 8:22 am
by mamo
Dear Eviews team,

I use EVIEWS 11 Sept 19 build, 64 bit.

Manually breaking long lines of code with the underscore character in a program does not seem to work as described in the documentation (c.f., quotation below): the example code below yields an error.

Best, mamo

Code: Select all

wfcreate a 2000 2010 series x=nrnd series y=3*x+4+nrnd equation eq1.ls _ y x c
Err.jpg
Err.jpg (14.38 KiB) Viewed 7501 times
http://www.eviews.com/help/helpintro.ht ... 23ww175823:
If you desire greater control over the appearance of your lines, you can manually break long lines using the ENTER key, and then use the underscore continuation character “_” as the last character on the line to join the multiple lines. For example, the three separate lines of text
equation eq1.ls _
y x c _
ar(1) ar(2)
are equivalent to the single line
equation eq1.ls y x c ar(1) ar(2)

Re: breaking lines of code with " _ " in program not working

Posted: Thu Feb 20, 2020 9:05 am
by EViews Gareth
Works fine for me.

Try updating to the latest version.

Re: breaking lines of code with " _ " in program not working

Posted: Wed Feb 26, 2020 5:18 am
by mamo
... okay, will update to the latest build.
With the current build, the trick seems to be that there must not be a space character immediately following the underscore ("_") sign in the first line in which the underscore is used.
In the following lies, the underscore sign can be followed by as many spaces as one may wish without creating an error.
(see example code below),
mamo

Code: Select all

wfcreate a 2000 2010 series x=nrnd series y=3*x+4+nrnd ' There must not be an empty space after the underscore sign in the following line: equation eq1.ls _ ' The underscore sign in the following line may be followed by one or more empty spaces: y x _ c

Re: breaking lines of code with " _ " in program not working

Posted: Wed Feb 26, 2020 6:09 am
by mamo
... and, unfortunately, breaking program lines within the definition of string variables with the underscore sign does not seem to work (irrespective of zero or spaces after the underscore character).

Code: Select all

%test="One Two Three _ Four"
Err.jpg
Err.jpg (10.38 KiB) Viewed 7425 times

Re: breaking lines of code with " _ " in program not working

Posted: Wed Feb 26, 2020 9:57 am
by EViews Matt
Hello,

Correct, the underscore character loses its special meaning for line continuation within a string literal. However, you can use a combination of string concatenation and continuation to achieve the desired result, e.g.,

Code: Select all

%test="One Two Three " + _ "Four"