Gretl Cli & Accented file names
by Henrique Andrade
Dear Gretl Team,
I'm trying to use Gretl CLI (1.10.90cvs, 2015-05-20) for some complex
scripts for the first time and I'm getting no success when I use accented
filenames. Something like this:
C:\Users\henrique>"c:\Program Files\gretl\gretlcli.exe" -b
"C:\Modelos\Relatorio.inp"
Works ok :-)
C:\Users\henrique>"c:\Program Files\gretl\gretlcli.exe" -b
"C:\Modelos\Relatório.inp"
Doesn't work ok :-(
Is this the intended behavior?
Best regards,
Henrique Andrade
9 years, 6 months
String as pointer argument
by Sven Schreiber
Hi,
a new thingy:
<hansl>
function void scheck (int a, string *s)
printf "%s\n", s
end function
string hey = "ho"
scheck(2, &hey)
</hansl>
produces:
<output>
gretl-Version 1.10.90cvs
Aktuelle Sitzung: 2015-05-13 09:38
? function void scheck (int a, string *s)
> function void scheck (int a, string *s)
Unrecognized data type 'string *'
Fehler bei Skriptausführung: Stopp
> function void scheck (int a, string *s)
</output>
Apart from the untranslated error message (could by my own fault)
apparently gretl doesn't accept strings to be passed in pointer form? Is
this deliberate? AFAICS the docs with respect to pointers just talk
about function arguments in general, not just scalars and matrices.
thanks,
sven
9 years, 6 months
--silent option for restrict with VECM
by Sven Schreiber
Hi,
I'm doing a VECM simulation with restricted estimates. Adding the
options "--full --silent" after the "end restrict" already does 99% of
what I want, namely to not produce printed output. However, two or three
lines of messages with respect to degrees of freedom of the Jacobian
remain. Is this remaining 1% of non-silence intended?
thanks,
sven
9 years, 7 months
tokenizer error
by Sven Schreiber
Hi,
with the latest snapshot (I think, how can I see the build date for
gretlcli.exe?) I get the following message:
+++ tokenizer: err=18 on 'loop foreach i @smnames --quiet'
where 'smnames' is a string variable with space-delimited names.
However, this doesn't seem to be an error because gretl doesn't stop but
continues to process the script. So what does err=18 mean and should I care?
thanks,
sven
9 years, 7 months
a little search&replace bug
by Sven Schreiber
Hi,
I think there's a small bug when you do search & replace in the script
editor: (Snapshot May 14th here) Suppose you want to replace xyz with
abc and you have three occurrences of "xyz" in a line. After replacing
the first xyz, when you hit the search button in the dialog again, gretl
finds the _third_ xyz, so it is missing the immediately next one.
(And BTW, on Windows at least the background color used for highlighting
the string that was found is very light and quite difficult to see IMO.
Another GTK thing? Is it settable somehow?)
thanks,
sven
9 years, 7 months
Package maintenance: string & install
by Henrique Andrade
Dear Gretl Team,
As a part of my job in function package maintenance, I'm trying to make a
Hansl script to (1) create a list of functions available in the Gretl
internet server, (2) download them using the new "install" command and, (3)
execute the examples.
I really appreciate your help to build a list with the names of the
functions. I'm using the following code to retrieve the names:
<hansl>
string functions_page = readfile("
http://ricardo.ecn.wfu.edu/gretl/cgi-bin/gretldata.cgi?opt=SHOW_FUNCS")
string line = ""
scalar i = 1
loop while getline(functions_page, line) --quiet
string line_name = sprintf("line_%d", i++)
string @line_name = strstr(line, "current_fnfiles/")
string @line_name = strstr(@line_name, "<tt>")
string @line_name = strsub(@line_name, "</td><td>", " ")
string @line_name = strsub(@line_name, "</a>", "")
string @line_name = strsub(@line_name, "</td></tr>", "")
string @line_name = strsub(@line_name, "<p>", "'")
string @line_name = strsub(@line_name, "<tt>", "'")
string @line_name = strsub(@line_name, "</tt>", "'")
string @line_name = strsub(@line_name, "</p>", "'")
string @line_name = strstrip(@line_name)
if @line_name = ""
delete @line_name
else
print @line_name
endif
endloop
</hansl>
It gives me something like this:
(...)
'addlist.gfn' 'Allin Cottrell' '1.2' '2010-12-17' 'Sequential addition
of variables to a model'
(...)
Now I need to use just the first piece of the string ("addlist") to combine
it with the install command. Something like this:
<hansl>
install addlist.gfn
</hansl>
Now my question: How could I extract the first "element" of my string?
Best regards / Um abraço,
Henrique Andrade
9 years, 7 months
gretl's trouble of distinguishing an array (of matrices) from its elements
by Sven Schreiber
Hi,
further trying to use arrays, it seems that gretl sometimes is confused
about the '+=' operator:
<hansl>
matrices mc
mc += ones(3,2) # += refers to whole array
mc[1] += ones(3,2) # += should refer to 1st array element
</hansl>
The last line gives a "datatype mismatch" error or something like that.
Apparently gretl sees that 'mc' is an array, then sees '+=' and thinks
this wants to append another array to mc, but on the RHS there is only a
single matrix. In reality of course on the LHS there is also just a
matrix which lives inside mc. (The long form "mc[1] = mc[1] + ..." works.)
Somewhat related perhaps, it is currently impossible to write something
like:
"matrix mc[1] = ones(3,2)"
because gretl complains that "variable mc is of type array, not
acceptable here". Not a big deal per se, but having to write "matrices"
instead feels awkward, since the operation really is just about one
element, not about the whole array.
I guess there is a logical connection to my complaint from a couple of
days back about a matrix inside a bundle (like mybundle.mymatrix) not
being 100% usable in hansl code as a standard matrix syntactically.
Allin answered that filling this gap would not be trivial. Here the
problem is about a matrix inside an array. I can imagine this is not
trivial, either. But somehow these limitations are starting to feel
restrictive.
thanks,
sven
9 years, 7 months
Problem with running gnuplot on OS X
by Berend Hasselman
I’m running gnuplot from the tools menu of Gretl 1.10.1 (same problem in latest gretl from CVS).
On OS X Yosemite with the Quartz version Gretl.
Gnuplot starts but when I issue the help command in gnuplot gnuplot responds with
/Applications/Gretl.app/Contents/Resources/bin/../Resources/share/gnuplot/4.6/gnuplot.gih: No such file or directory
and no help is shown.
Berend
9 years, 7 months
crash with search/replace
by Sven Schreiber
Hi,
I just got a gretl crash on Windows (7 64bit, snapshot from May 12th)
when I did some search-and-replacing in the (tabbed) script editor.
Don't know if it is part of the trigger, but I "left" the replace dialog
window by clicking in the editor window, deleted some text, clicked back
in the replace dialog and continued searching (clicked the search button).
Could be a GTK bug I guess. ?
thanks,
sven
9 years, 7 months
Some issues (arrays and bundles)
by Sven Schreiber
Hi,
I've started working with arrays, and here are two small issues or
questions.
1. The help for 'genr' says: "In the appropriate context, series,
scalar, matrix, string and bundle are synonyms for this command."
It seems this statement has to be amended with the array
correspondences, 'matrices', 'strings' (and 'bundles'?), as in:
"matrices mymarr[3] = zeros(1,1)".
(I also noted that using 'matrix' doesn't work here which is ok I guess.)
2. If 'checks' is an array of matrices, is this supposed to work? (It
doesn't in the current snapshot.):
"print checks[3]"
3. Then there is another thing related to bundles, see this example:
<hansl>
bundle bcheck = null
matrix bcheck.mymat = ones(1,1)
bcheck.mymat ~= zeros(1,1)
</hansl>
which gives me a "~= not implemented for this type" error. So a matrix
inside a bundle somehow isn't a first-class matrix it seems. (The
workaround "bcheck.mymat = bcheck.mymat ~ zeros(1,1)" works.)
4. Also bundle-related is a very weird behavior where gretl doesn't
acknowledge the bundle it just created:
<hansl>
stop = 10
loop i=1..stop --quiet
bundle bSim = null
bSim.p = 2
endloop
</hansl>
tells me "bSim: no such object"!!?? Notice that the wrapping loop seems
to be necessary to provoke this error.
thanks,
sven
9 years, 7 months