sequences, i'm confused, as usual

new topic     » topic index » view thread      » older message » newer message

Please? I can't figure this out,,, in the code below, in the first match() i
must use {} to get it to work right, but in the 2nd match(), i don't? If i
*don't* use {} in the 1st one, it fails,, if i *do* use {} in the 2nd one,
it fails. I don't mean the "=" and "!=" in the following lines, i mean the
match() fails. What am i not understanding now?

procedure addrec(sequence rootname, sequence newrec)
integer place

 rootname = "xx" & rootname & "xx"
 newrec = "xx" & newrec & "xx"
 trace(1)
 place = match({rootname},mainseq)
 if ( place = 0 ) then
   puts(1,rootname & " doesn't exist!" & "\n")
   return
 end if
-- trace(1)

 place = match(newrec,mainseq[place])
 if ( place != 0 ) then
   puts(1,newrec & " exists already!" & "\n")
   return
 end if

end procedure -- addrec(sequence rootname, sequence newrec)

Kat,
confused as heck again.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu