match use
- Posted by sixs at ida.net May 13, 2002
- 403 views
This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C1FB7D.60B2D120 charset="iso-8859-1" I am having a problem with match. location is to hold the starting = position of Name is the string of data. I want to then pick the Name = and to he data following for value of Name. My illustration doesn't = work. Is the result location "Name" a number value?=20 I want to put the value of name back into data. I have described = location as an atom, function InsertCRLFs(sequence data) atom location sequence dat dat =3D {} location =3D match("Name", data) -- location is set to 3 =20 dat =3D getText(data[location..3]) return dat end function ------=_NextPart_000_0009_01C1FB7D.60B2D120 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2722.2800" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I am having a problem with match. = location is=20 to hold the starting position of Name is the string of data. I = want to=20 then pick the Name and to he data following for value of Name. My = illustration=20 doesn't work. Is the result location "Name" a number value? = </FONT></DIV> <DIV><FONT face=3DArial size=3D2>I want to put the value of name back = into data. I=20 have described location as an atom,</FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>function InsertCRLFs(sequence = data)</FONT></DIV> <DIV><FONT face=3DArial size=3D2>atom location<BR>sequence dat dat = =3D=20 {}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2> location =3D match("Name", = data)<BR>-- location=20 is set to 3</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2> <FONT face=3DArial=20 size=3D2> <BR></FONT></FONT><FONT face=3DArial size=3D2>dat =3D=20 getText(data[location..3])<BR> return dat<BR>end=20 ------=_NextPart_000_0009_01C1FB7D.60B2D120--