nesting a function call getting a list doesn't work
by Sven Schreiber
Hi,
instead of creating an interim list variable I wanted to use the
returned list from a function directly for further operations, but that
failed:
<hansl>
function list checkl(void)
genr time
list out = const time
return out
end function
matrix v = zeros(2,1)
list foo = checkl()
series hey1 = lincomb(foo, v) # works
print hey1
series hey2 = lincomb(checkl(), v) # doesn't work
print hey2
</hansl>
I would think that's a bug.
thanks,
sven
9 years, 5 months
getenv(): about environment strings
by yinung@Gmail
Dear all,
I just try the following envioenment strings with the hansl script below
under winXP.
I testes with both gretl 1.10.90cvs and 1.10.1. The results turned the
same. It looks that many of the strings returned null strings. Is this what
sven said "... wasn't able to get anything out of it?"
Thanks
Yi-Nung
<hansl>
envString = "TEMP USER HOME gretldir workdir dotdir gnuplot tramo x12a
tramodir x12adir"
loop foreach j @envString
string s=getenv("$j")
printf "env string $j=**%s**\n",s
endloop
</hansl>
====gretl's output====
gretl version 1.10.90cvs
Current session: 2015-06-22 09:38
? envString = "TEMP USER HOME gretldir workdir dotdir gnuplot tramo x12a \
tramodir x12adir"
Generated string envString
? loop foreach j @envString
> string s=getenv("$j")
> printf "env string $j=**%s**\n",s
> endloop
? string s=getenv("TEMP")
env string TEMP=**C:\DOCUME~1\yinung\LOCALS~1\Temp**
? string s=getenv("USER")
env string USER=****
? string s=getenv("HOME")
env string HOME=****
? string s=getenv("gretldir")
env string gretldir=****
? string s=getenv("workdir")
env string workdir=****
? string s=getenv("dotdir")
env string dotdir=****
? string s=getenv("gnuplot")
env string gnuplot=****
? string s=getenv("tramo")
env string tramo=****
? string s=getenv("x12a")
env string x12a=****
? string s=getenv("tramodir")
env string tramodir=****
? string s=getenv("x12adir")
env string x12adir=****
Number of iterations: 11
9 years, 5 months
colnames() (and rownames() etc.) and string arrays
by Sven Schreiber
hi,
perhaps mentioned before: colnames() and friends really should accept
string arrays as arguments in addition to space-separated strings. It
would be so natural it feels very weird that they don't.
thanks,
sven
9 years, 5 months
strange error with built-in function call as user function argument
by Sven Schreiber
Hi,
here's something I don't understand. The following two lines inside a
program work fine:
...
value = $pi * cdf(N, finput)
list lc = getFGrangerReg(X, Y, p, value)
...
where of course getFGrangerReg() is a user-defined function which
returns a list, and all the variables are appropriately defined.
Now when I substitute out the "value" scalar as a function argument,
like this:
...
list lc = getFGrangerReg(X, Y, p, $pi * cdf(N, finput))
...
I get an "invalid argument" error. However, I could not build a minimal
example, so in principle passing things like $pi * cdf(N, finput) as an
argument does work in the trivial examples I was trying.
(Notice that gretl didn't mention "getFGrangerReg" in the error message,
but rather the name of the outer function in which this code resides.)
So I'm puzzled...
(Snapshot June 9th.)
thanks,
sven
9 years, 5 months
Package maintenance: sample scripts
by Henrique Andrade
Dear Gretl Team,
As we are discussing function duplicates (please take a look at the thread:
"Proposal for function package cleanup"), coincidentally I just finished a
script that allow us to download, install and run all the sample scripts
available in the Gretl's server.
This is the first round that function package maintenace script. The test
is very simple:
step 1: Download and install the latest Gretl snapshot;
step 2: Using a Hansl script (written by me with the important help from
Allin and Riccardo) I install all the packages available from Gretl's
server;
step 3: Using the same Hansl code, I extract the sample script of each of
these functions and try to execute them.
I will do the tests in Mac OS/X and Windows (I don't have the necessary
Linux skills to do this) and write a simple report (attached the Windows
one to this message).
Best regards,
Henrique Andrade
9 years, 5 months
Syntax highlighting
by Marcin Błażejowski
Hi,
simple function:
function void foo (const scalar *a, const scalar *b)
printf "%d\t%d\n", a, b
end function
The first 'const' is black since the second is highlighted.
Best Regards,
Marcin
--
Marcin Błażejowski
GG: 203127
9 years, 5 months
duplicate function package name
by Sven Schreiber
Hi,
in the function package list on server (from within gretl) I'm seeing
two entries "BMA", one 1.2 and the other 1.22. How are duplicate names
possible?
thanks,
sven
9 years, 5 months
problems with int pointer
by Sven Schreiber
Hi,
gretl doesn't accept a pointerized "int" argument it seems, as opposed
to a plain "scalar":
<hansl>
function void check1(scalar *hey) # works
print hey
end function
function void check2(int *ho) # doesn't work
print ho
end function
</hansl>
gives:
<error>
Unrecognized data type 'int *'
Fehler bei Skriptausführung: Stopp
</error>
Is this intended? (I wouldn't think so -- in section 13.4 of the guide
it just says "scalar ... can be passed in two ways" and not explicitly
int, but since before the guide says "int -- scalar variable acting as
an integer" I think this should apply to int as well.)
thanks,
sven
9 years, 5 months
Not marked translation string: "matrix is empty"
by Henrique Andrade
Dear Allin and Jack,
I think the string "matrix is empty" is not marked for translation. It
appears in the following context:
? matrix Matriz = {}
? print Matriz
Matriz: matrix is empty (0 x 0)
Best,
Henrique Andrade
9 years, 5 months
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, 5 months