1. Re: [E - 1 to 2 Jun 1997] I need help! (again :>)
- Posted by JEFF ZEITLIN <jeff.zeitlin at EXECNET.COM> Jun 04, 1997
- 680 views
Joseph Martin <jam at MAILHUB.EXIS.NET> writes... E::>I'm writing a program to read in a file and change certain pieces of ::>text to something else. For instance in the file I would change all ::>instances of '1' to '2'. However when I try to "find" the text I want ::>to change in my sample file it returns 0. Can anyone help? E::>trace(1) ::>? file[1] ::>for i = 1 to length(file) do ::> n = find("1", file[i]) Your problem is right here: find() looks for its first argument as a member of the sequence represented by its second argument. A string in double quotes is a sequence. You're actually looking for the sequence {49} in the line. What you want to do instead is n = find('1', file[i]) which will look for the _atom_ 49 in the line. ========================================================================= Jeff Zeitlin jeff.zeitlin at execnet.com --- ~ OLXWin 1.00b ~ Mene mene tekel upharsin.