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