Dear Gretl Team,
I'm restarting to write the "missing" examples for Gretl functions and
commands (please take a look at this thread
http://lists.wfu.edu/pipermail/gretl-devel/2012-November/004088.html) and I
would like to hear from you if the following examples fit our "quality
standard" (if yes I will edit the XML files in CVS):
<hansl>
# Missing examples
### colname ###
matrix A = { 11, 23, 13 ; 54, 15, 46 }
colnames(A, "Col_A Col_B Col_C")
string name = colname(A, 3)
print name
### nlines ###
string web_page =
readfile("http://gretl.sourceforge.net/")
scalar number = nlines(web_page)
print number
### readfile ###
string web_page =
readfile("http://gretl.sourceforge.net/")
print web_page
string current_settings = readfile("(a)dotdir/.gretl2rc")
print current_settings
### strlen ###
string s = "regression"
scalar number = strlen(s)
print number
### strsplit ###
string basket = "banana apple jackfruit orange"
strings fruits = strsplit(basket)
eval fruits[1]
eval fruits[2]
eval fruits[3]
eval fruits[4]
string favorite = strsplit(basket, 3)
eval favorite
### strstr ###
string s1 = "Gretl is an econometrics package"
string s2 = strstr(s1, "an")
print s2
### strstrip ###
string s1 = " A lot of white space. "
string s2 = strstrip(s1)
print s1 s2
### strsub ###
string s1 = "Hello, Gretl!"
string s2 = strsub(s1, "Gretl", "Hansl")
print s2
### substr ###
string s1 = "Hello, Gretl!"
string s2 = substr(s1, 8, 12)
print s2
string s3 = substr("Hello, Gretl!", 8, 12)
print s3
### tolower ###
string s1 = "Hello, Gretl!"
string s2 = tolower(s1)
print s2
string s3 = tolower("Hello, Gretl!")
print s3
### toupper ###
string s1 = "Hello, Gretl!"
string s2 = toupper(s1)
print s2
string s3 = toupper("Hello, Gretl!")
print s3
### varname ###
open broiler.gdt
string s = varname(7)
print s
### varnames ###
open keane.gdt
list L = year wage status
strings S = varnames(L)
eval S[1]
eval S[2]
eval S[3]
</hansl>
Best,
Henrique Andrade