Whether the Eviews is case-sensitive in strings?
i.e. here:
Cases 1) works, but case 2) doesn't.
1) %name_root = @left(%name_var, @instr(%name_var, "_mm"))
or
2) %name_root = @left(%name_var, @instr(%name_var, "_MM"))
Case-sensivity
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Case-sensivity
aha. ok.
But then, sometimes it is vice versa. Case 2) works, but Case 1) doesn't. I have few subroutines with "_MM" uppercases. I wonder how it might be?! when all the elements in workfile have lowercases... What it depends on?
1) %name_root = @left(%name_var, @instr(%name_var, "_mm"))
2) %name_root = @left(%name_var, @instr(%name_var, "_MM"))
Regards
Andrei
But then, sometimes it is vice versa. Case 2) works, but Case 1) doesn't. I have few subroutines with "_MM" uppercases. I wonder how it might be?! when all the elements in workfile have lowercases... What it depends on?
1) %name_root = @left(%name_var, @instr(%name_var, "_mm"))
2) %name_root = @left(%name_var, @instr(%name_var, "_MM"))
Regards
Andrei
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Case-sensivity
I don't understand your question. The @instr function is case-sensitive.
Follow us on Twitter @IHSEViews
Re: Case-sensivity
Ok. let put it in an example. My confusion is the following. In the code below, I generate series ser1_mm and ser2_mm, having in mind they are lowercases. Then to subtract suffix "_mm" (lowercase) I exploit @instr with uppercase "_MM". Why "_MM" in uppercases? Note, "_mm" (lowercase) doesn't work for me later to obtain ser1_yy and ser2_yy. What forces Eviews to understand "_MM", but not "_mm"?
Regards
Andrei
Code: Select all
smpl @all
genr ser1_mm = 0 'lowercase!!
genr ser2_mm = 0 'lowercase!!
group _gr_ser ser1_mm ser2_mm
for !C = 1 to _gr_ser.@count
%name_endog = _gr_ser.@seriesname(!C)
%name_endog_root = @left(%name_endog, @instr(%name_endog, "_MM")-1) '_MM is uppercase!! why??
genr {%name_endog_root}_yy = {!C}
next
Regards
Andrei
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Case-sensivity
Objects in a workfile are case insensitive. There is no difference between the series "AAA" and the series "aaa". They are the same series. You can create a series called "AAA" and it will be shown as "aaa" in the workfile. You can refer to that series as "aaa" or "AAA" and EViews will know what you mean.
Functions that work with strings are, in general, case-sensitive.
Functions that return information about objects as a string are, in general, returned in upper-case.
Functions that work with strings are, in general, case-sensitive.
Functions that return information about objects as a string are, in general, returned in upper-case.
Follow us on Twitter @IHSEViews
Re: Case-sensivity
ok. thanks. Now I understood what the problem is. I have another example below, where I treated series name as string without refering to object, that's why in this case "_mm" (lowercases) was the solution, but not "_MM". This raised my confusion.
In turn, in previous example I treated series names as strings refering to group objects.
But then do we have any function that extracts string referring to series name? something similar to what we have for group elements:
(from the code before)
group _gr_ser ser1_mm ser2_mm
%name_endog = _gr_ser.@seriesname(!C)
potentially might be something like this to extract series name as string:
%name_endog = ser1_mm.@seriesname
In turn, in previous example I treated series names as strings refering to group objects.
Code: Select all
smpl @all
genr ser1_mm = 0 'lowercase!!
call mysub("ser1_mm")
subroutine mysub(string %name_var)
%name_endog_root = @left(%name_var, @instr(%name_var, "_mm")-1) ' Now "_mm" works, but not "_MM"
genr {%name_endog_root}_yy = 1
endsub
But then do we have any function that extracts string referring to series name? something similar to what we have for group elements:
(from the code before)
group _gr_ser ser1_mm ser2_mm
%name_endog = _gr_ser.@seriesname(!C)
potentially might be something like this to extract series name as string:
%name_endog = ser1_mm.@seriesname
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Who is online
Users browsing this forum: No registered users and 35 guests