@wfindnc - bug?
Posted: Thu Dec 17, 2015 2:47 am
Hi
try and run the following code where you open the attached workfile:
close @all
%dir=@runpath
cd %dir'"C:\tvb\articles\labour_services\eviews"
wfopen wfindnc
for !i=570 to 571
%eq=kvartstroll.@line(!i)
if @isobject("test")=1 then
delete test
endif
model test
test.append {%eq}
'generate text file with equations where endogenous variable has already been defined
text problemequations
'TRY TO UNCOMMENT THE FOLLOWING LINE:
scalar a_{!i}_=@wfindnc(kvarts.@endoglist,@trim(test.@endoglist))
'-------------------------------------------------------------------------------------------
if @wfindnc(kvarts.@endoglist,@trim(test.@endoglist)) = 0 then
kvarts.append {%eq}
else
problemequations.append {%eq}
problemequations.append {!i}
endif
next
This creates a blank textfile problemequations. However, if you comment out the scalar a_{!i}_.... line and rerun the program, the textfile problemequations is filled with some text, for some reason. Do you understand what is causing this?
THomas
try and run the following code where you open the attached workfile:
close @all
%dir=@runpath
cd %dir'"C:\tvb\articles\labour_services\eviews"
wfopen wfindnc
for !i=570 to 571
%eq=kvartstroll.@line(!i)
if @isobject("test")=1 then
delete test
endif
model test
test.append {%eq}
'generate text file with equations where endogenous variable has already been defined
text problemequations
'TRY TO UNCOMMENT THE FOLLOWING LINE:
scalar a_{!i}_=@wfindnc(kvarts.@endoglist,@trim(test.@endoglist))
'-------------------------------------------------------------------------------------------
if @wfindnc(kvarts.@endoglist,@trim(test.@endoglist)) = 0 then
kvarts.append {%eq}
else
problemequations.append {%eq}
problemequations.append {!i}
endif
next
This creates a blank textfile problemequations. However, if you comment out the scalar a_{!i}_.... line and rerun the program, the textfile problemequations is filled with some text, for some reason. Do you understand what is causing this?
THomas