Re: Find 3: The Reckoning

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

Take a look at the sequence returned by gets(0).
"input=gets(0)" also "gets" the return char at the end of line when
you hit the 'enter' key and looks like a 10 decimal at the
end of the sequence.  When you try to compare it or 'find' it,
what you end up comparing is really the word you type in
plus the line feed (decimal 10) at the end of the word.
You must remove this before comparing it with any other word
by deleting the last char from the word you type in:

object inputstring

inputstring=gets(0)

? inputstring --view with the extra char at end of word

if sequence(inputstring) then
  inputstring=inputstring[1..length(inputstring)-1]
else
  inputstring=""
end if

? inputstring --view without the extra char

puts(1,"press a key to exit")

ink=wait_key()


Good luck with it....
--Al

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

Search



Quick Links

User menu

Not signed in.

Misc Menu