I have a program that uses a specific word string in the options section of wfopen, in the range command in the wfopen line, in the close command, in the wfcreate command, in the group command, in the write command, in the pagesave command, and in the wfsave command
For example:
wfopen(wf=Alpha) "C:\a.xlsx" range=alpha!a1 colhead=2 namepos=all @freq 7 12/1/2009
"Alpha" is used in that line and all of the typed of eviews commands I listed above.
Is it possible to run a loop that would do everything for Alpha, then run the program over for Beta, etc.?
Using strings
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Using strings
Code: Select all
for %mystr "alpha" "beta" "gamma"
wfopen(wf={%mystr}
import(wf={%mtstr}
next
Re: Using strings
This appears to work for all of the commands in my program with the exception of the WRITE command. The name of the output xls file ended up including %mystr, possibly because the name of the file was in quotes and enclosed the {%mystr}
Is there any way around this?
I'd like to write a new csv file for each loop of the program.
Is there any way around this?
I'd like to write a new csv file for each loop of the program.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Using strings
Create a new string equal to the full path:
Code: Select all
%path="c:\my path\" + %mystr + "\file.xls"
Write %path
Who is online
Users browsing this forum: No registered users and 2 guests
