(BASIC) string handling advice

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
Fahnn
Microbot
Posts: 135
Joined: Sun Jan 27, 2019 7:56 pm
Location: Redcar, UK
Contact:

Re: (BASIC) string handling advice

Post by Fahnn »

Joefish wrote: Fri May 24, 2019 1:08 pm I'd always start by splitting the input up into words by scanning along it and anything that's 'whitespace' (space, returns, commas, quotes, colons, end of the string etc.) becomes a point at which you break off a separate word and store it. Then you look up each word.
I'd not even considered punctuation. Man, I am dense sometimes. However...
Joefish wrote: Fri May 24, 2019 1:08 pmOtherwise you end up with partial matches and think 'Scunthorpe' is a swearword... Which is is, in a way. Just not that way. :lol:
You've just given me the most amazing idea! My thinking about this has been backwards from the start but now I know exactly what course I'm going to take. Not only will it really speed things up, it's going to contribute massively to the "confused interpretation" thing I want to get going. I honestly can't thank you enough for this!
Post Reply