Page 1 of 1

Disjunction of text and values

Posted: Thu Oct 02, 2008 6:49 am
by Katjes
After freezing e.g. the table with Johansen cointegration test results you can simply retrieve the cells content:

Code: Select all

scalar x = @val(tab1(12,3))
or

Code: Select all

%x = @str(tab1(10,3))
But how can I separate between text and values in one cell? The cell tab(1,3) contains e.g. "Included observations: 113", but I only want to select the value "113".
Thanks for helpful comments!

Posted: Thu Oct 02, 2008 7:59 am
by EViews Gareth
You can use some string functions to extract the number part of the string, and then convert that part into a number. The following example does this by searching for a ":" in the string, then converting the text following the ":" into a number:

Code: Select all

%temp = tab1(1,3) !i = @instr(%temp,":") %temp2 = @mid(%temp,!i+2) !obs = @val(%temp2)