07-17-2009, 09:11 AM
int i=0
foreach _s Fichier
,i+1
,if(findrx(_s "like" 0 1 match)<0) continue
,out "the line containing ''like'' is %s" _s
,out "the number of the line is %i" i-1
question 1: is _s variable a variable created directly by the macro when called? what type is it?
question 2: in fact my function is a bit more complex and would be:
str match Fichier.getfile(myfile.txt)
ARRAY(str) u=Fichier
ARRAY(str) o.create(0(line text) 0(line number))
Grep(&u &match &o)
and i'd like to store the pair (_s i) in a two dim array o as result, but it does not work
so i can out for instance : out "the line %i containing %match is %s" o[line number] match o[line text]
How?
foreach _s Fichier
,i+1
,if(findrx(_s "like" 0 1 match)<0) continue
,out "the line containing ''like'' is %s" _s
,out "the number of the line is %i" i-1
question 1: is _s variable a variable created directly by the macro when called? what type is it?
question 2: in fact my function is a bit more complex and would be:
str match Fichier.getfile(myfile.txt)
ARRAY(str) u=Fichier
ARRAY(str) o.create(0(line text) 0(line number))
Grep(&u &match &o)
and i'd like to store the pair (_s i) in a two dim array o as result, but it does not work

so i can out for instance : out "the line %i containing %match is %s" o[line number] match o[line text]
How?
