|
Post by Shadow on Sept 19, 2002 20:03:03 GMT
I'm making a basic DOS RPG, meaning I need to make LOTS of LOOPS. There are so maney of them I can't use the IF a$ = "<whatever he/she says>" THEN EXIT DO so I use IF a$ = "<whatever he/she says>" THEN GOTO p1 But I can't get the ELSE command to work right Here's what I'm working on (no this is just an example of it):
DO CLS PRINT "Hi" INPUT "", a$ IF a$ = "Hello" THEN GOTO p1 IF a$ = "hello" THEN GOTO p1 ELSE PRINT "You refues to becuse...." LOOP p1: PRINT "done" END ----- Also tried ----- DO CLS PRINT "Hi" INPUT "", a$ IF a$ = "Hello" OR a$ = "hello" THEN GOTO p1 ELSE PRINT "You refues to becuse...." LOOP p1: PRINT "done" END ----- Any Ideas? Thanks! Also, can I use Wildcards (*)? Like IF a$ = "*hello*" THEN PRINT "...."
|
|
|
Post by Programmer on Sept 19, 2002 23:14:01 GMT
i dont know because it works with qb 4.5
|
|
|
Post by Elias not at home on Sept 28, 2002 16:14:21 GMT
As an experienced Qb user i can make some recomendations for you:
1.- if you are making an RPG in qbasic try to incorporate EMS memory from the begining, because DOS memory is like gold.
2.-Make the text handling routines before the history routines, this way you will have all the time to make the history of the game as you wish.
3.-Try not to use any Gosubs (some times they are very needed, use them only in those cases), try to make SUBS instead.
4.-learn about multiple module programming in QB. this way you can compile bigger programs.
5.-If you need to dim an array dont DIM SHARE it, it makes a bigger EXE and causes the OUT OF MEMORY error when compiling, try to DIM the array in the same SUB were it will be used.
6.-Make a special sub for error handling, because RESUME NEXT its a memory eater when compiling.
7.-Make graphics before starting the programming. this way you will be focused on the programming and you will not be distracted by anything else.
8.- oh, by the way... i suggest not to use Print command, LOL. the font is ugly. try to DRAW or get font to EMS for a better looking font.
Wildcards when looking for certain text in a text string are not needed if you ise INSTR, here's how you use it:
TEXT$ = "This is a line of text." IF INSTR(TEXT$, "line") > 0 then WORDFOUND
INSTR returns the position were the text is located in the text string, if a zero value is returned the text is not on the string.
i hope this tips help.
|
|