Does anyone know how to program so you can have a search box? That is, if I made a dictionary program, how can I have a search box so you can instantly find any word?
Thank you very much for answering. I am a beginner, but maybe not absolute. I know I to place sprites and do basic things like that including input. Do you think you could help me figure this out. I'm not completely sure how to use data files. I also kind of have a messy word storing system. I was trying to figure out how to put the words in a box and when they go past a certain point during scrolling, they go out of sight without everything going as well.
if I used print, then once the words go off the screen, wouldn't they disappear so if you scroll back up they are not there anymore? Also, I'm still not sure how to create a search box. What commands would I use other than input so it searches for words?
Oh you want to be able to scroll back up? You'll have to keep a history for that, which means more complex programming. The basic idea is to have an array that holds every line you've printed, then every time you PRINT something you also put it in this array. When you want to scroll up, you reprint the whole screen using an offset into the history array. I can't give an example right now, sorry.
If you want a fancy searchbox where it gives options as you type, that's quite a lot more complex than just accepting the whole word using INPUT then running your search function. You'll have to use INKEY to capture individual characters to build up a string, and also use an appropriate XSCREEN so the keyboard is always displayed (I think the default is fine though). After each character is typed, you run the string so far (that you built from each keypress) into your search function. Again, I can't give example code right now; I'm really sorry.
As I said, this is a very complex project for someone who's a beginner. I would try other things that are similar but that you can do on your own with the knowledge you currently have. If you dive headfirst into something with this many unknowns, it quickly becomes impossible to proceed (as you can probably see with the ever-mounting pile of stuff you'll have to learn just to do this seemingly simple task). However, if you start a project where you can do over half of it without help, you can take smaller steps into the unknown and eventually come out with something.
Thank you. No examples are fine. I've tried simpler things before, always failing because I didn't know what to do next. The best thing I did (completed) was a calculator. I thought a dictionary would be good to do next since it's mostly just text and not sprites and whatnot. I don't mean an English dictionary, by the way. I mean an English to Japanese dictionary.
Thanks for taking time to help me. It really does help. Also...you wouldn't know how to change the smilebasic source avatar, would you?
Thanks. So, do you know alot about the data function?
Right. So when I tried to print information from data like this:
Data "Dogs"
Data "Cats"
Data "Lizards"
All of them printed on top of each other. How do I specify for them to be in different places?
DATA has nothing to do with where they print. Code doesn't magically connect itself: you should think of program instructions as the most basic commands you can give. They don't do anything more than what you tell them to do, and DATA only tells the computer (or DS) "here's some data". The part that actually puts it on screen is you doing LOCATE and then PRINT. LOCATE also does no more than one thing: it just puts the cursor at a place on screen. If you give it the same place every time you call LOCATE, the cursor will always go to the same place. PRINT just prints wherever the cursor is.
Yeah, so how do I make them print in different places without dealing with each individual string separately? I'm still trying to set up a japanese/english dictionary.
I tried that, but in stead, they still printed on top of eachother and doubled. Like a stack of words here and over there. Plus, I use more than one data instruction.
I just tried it. And it works when it uses one data line, but not three.