[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2019-02-27T14:43:40-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/10224 2019-02-27T14:43:40-05:00 2019-02-27T14:43:40-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=33476#p33476 <![CDATA[Re: Menu issues]]> Statistics: Posted by knothead1008 — Wed Feb 27, 2019 2:43 pm


]]>
2019-02-27T01:19:02-05:00 2019-02-27T01:19:02-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=33475#p33475 <![CDATA[Re: Menu issues]]>

Code:

255 PRINT TAB(25); "0. Go back"265 IF (MB = 0) THEN 110335 PRINT TAB(25); "0. Go back"345 IF (FI = 0) THEN 190
etc.

Statistics: Posted by MikeHawk — Wed Feb 27, 2019 1:19 am


]]>
2019-02-26T22:38:36-05:00 2019-02-26T22:38:36-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=33474#p33474 <![CDATA[Re: Menu issues]]>

Code:

108 ' AFTER THE PROGRAM RUNS PRESS "R" TO RUN AGAIN, OR "Q" TO QUIT.110 CLS : PRINT : PRINT : PRINT : PRINT TAB(27); "Type of Knot"120 PRINT TAB(25); "1. Casa Knot"130 PRINT TAB(25); "2. Standard Two Pass Knot"140 PRINT TAB(25); "3. Standard Three Pass Knot"150 PRINT TAB(25); "4. Gaucho or Headhunter's Knot"155 PRINT : PRINT TAB(20); "To end program now hold down  ctrl  press c"158 PRINT : PRINT TAB(12); "AFTER THE PROGRAM RUNS PRESS R TO RUN AGAIN, OR Q TO QUIT"160 PRINT : PRINT TAB(24); : INPUT "Choose one of the above "; MA170 IF MA < 1 THEN 110 ELSE IF MA > 4 THEN 110180 ON MA GOTO 710, 190, 190, 610190 CLS : PRINT : PRINT : PRINT TAB(25); "Type of Standard Knot"200 PRINT TAB(25); "1. Standard Herringbone Knot"210 PRINT TAB(25); "2. Standard Pineapple Knot"220 PRINT TAB(25); "3. Standard Pineapple-Sobre Knot (Even Number Parts)"230 PRINT TAB(25); "4. Semi-Regular Quasi-(Headhunter or Gaucho) Knot"240 IF MA = 3 THEN PRINT TAB(25); "5. Standard Hood Knot"250 IF MA = 3 THEN PRINT TAB(25); "6. Standard Horn Knot"260 PRINT : PRINT TAB(25); : INPUT "Choose one of the above"; MB270 IF MB < 1 OR MB > 6 THEN 190280 ON MB GOTO 480, 290, 290, 490, 500, 510290 CLS : PRINT : PRINT : PRINT TAB(15); "Position of Bight-Boundries for Second Knot"300 PRINT TAB(25); "1. Bight - Boundary 1--1"310 PRINT TAB(25); "2. Bight - Boundary 2--2 (Standard Pineapple)"320 PRINT TAB(25); "3. Bight - Boundary 1--2"330 PRINT TAB(25); "4. Bight - Boundary 2--1"340 PRINT : PRINT TAB(25); : INPUT "Choose one of the above"; FI350 IF FI < 1 OR FI > 4 THEN 290360 IF MA = 2 THEN 520370 CLS : PRINT : PRINT : PRINT TAB(15); "Position of Bight - Boundaries for Third Knot"380 IF FI = 2 OR FI = 1 THEN 440390 PRINT TAB(25); "1. Bight - Boundary 3--3"400 PRINT TAB(25); "2. Bight - Boundary 1--3"410 PRINT TAB(25); "3. Bight - Boundary 3--1"420 PRINT : PRINT TAB(25); : INPUT "Choose one of the above"; SI430 IF SI < 1 OR SI > 3 THEN 370 ELSE 520440 PRINT TAB(25); "1. Bight - Boundary 3--2"450 PRINT TAB(25); "2. Bight - Boundary 1--2"460 PRINT TAB(25); "3. Bight - Boundary 2--1"470 GOTO 420

Statistics: Posted by knothead1008 — Tue Feb 26, 2019 10:38 pm


]]>
2019-02-26T09:41:59-05:00 2019-02-26T09:41:59-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=33472#p33472 <![CDATA[Re: Menu issues]]>
Each menu is barely more than a bunch of items that the user can select. Each item can either execute a very specific action (save configuration, apply changes, exit program), change a setting (modify the content of a variable), or redirect to another menu. From there, you can just create a one-size-fits-all routine to handle all your menus.

Lately I've been relying on DATA statements to identify menus and their content, even though I recognize that two separate arrays with custom types would be a much more flexible approach: one array for menus and one for items. Each element in the menu array could contain the name of your menu, how many items appear in there, what is the offset of the first item in the array list, and whatnots. The item array would contain each and every item of all your menus, consecutively. They would contain a label to display on screen, and a function string so you know what to do when the user interacts with it (use prefixes or extra fields to code special behaviors like "switch menu" or "change variable", the rest of the string would tell you the menu name to switch to, or the variable name to modify) - the function string can also influence the way the item should be displayed on screen…

If you know how menus are connected (say "Menu1>Menu2>Menu5"), you don't need anything special to "go back" (say you're in Menu5, the "go back" item will simply be programmed to always switch to Menu2). Or you don't, in which case you need to keep track of how menus are browsed (via a string for instance). Currently parsed menu is added to the right of that string, and thus, going back will just delete the last character, returning the user to the new rightmost menu number.

When it comes to "forgetting changes" in-between menus, the simplest way would be to create a set of temporary variables where you write the changes made. All the actual variable must be copied to the temporary set as the user enters the new menu, then, if the user confirms changes upon exit, copy the temporary set to the actual variables you use in your program; if the user ignores, do nothing (the temporary set will be overwritten on next entry to that menu anyway).

Hope that helps.

Statistics: Posted by MikeHawk — Tue Feb 26, 2019 9:41 am


]]>
2019-02-21T17:00:09-05:00 2019-02-21T17:00:09-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=33470#p33470 <![CDATA[Menu issues]]>
I have a program that has 4 menus. To which normal operation for the end user works fine as is. What I would like to do is create a way for the user to go back to the previous menu if they decide to or if they make a mistake in choice. For the most part I have one menu working. The issue is when I get to menu 3 I can get it to go back, but when it does, I have double menus on one screen and for some reason the app is remembering the user input from the last menu and adding that into the go back menu.

I don't know if that came out clear or not. But if it did not. Please let me know.

Brian.

Statistics: Posted by knothead1008 — Thu Feb 21, 2019 5:00 pm


]]>