Page 1 of 1

problem with @makevalidname

Posted: Fri Jan 31, 2025 10:00 am
by maragloria
Hi there,

I'm getting a problem with @makevalidname. It cleans the original string as expected, but it adds an "01" at the end of string returned.

For example:

string cleanName = @makevalidname("CSR#(USWOGGG%R,N)")
is returning "CSR__USWOGGG_R_N_01" even though eviews automatically names the series "CSR__USWOGGG_R_N_".

When I try to rename the series CSR__USWOGGG_R_N_ with another name, I get an error message since I'm searching with cleanName "CSR__USWOGGG_R_N_01" which is not found in the workfile.

I've attached the file with just the series.

Re: problem with @makevalidname

Posted: Fri Jan 31, 2025 10:17 am
by EViews Gareth
Probably means there is already an object with that name in the workfile. @makevalid name both checks whether the name is valid, and if there is an existing object with that name. As can be seen in this example:

Code: Select all

close @wf wfcreate u 100 string cleanName = @makevalidname("CSR#(USWOGGG%R,N)") show cleanName series {cleanname} string cleanName2 = @makevalidname("CSR#(USWOGGG%R,N)") show cleanname2

Re: problem with @makevalidname

Posted: Fri Jan 31, 2025 10:22 am
by maragloria
Ah, I think I get what the problem is coming from.