Just figured out how to fix the stack space error in Wry....
Mon Jun 08, 2020 3:18am

The pre-title/title screen should be the "loader" BAS file, then should chain to the main application BAS file.

There should be some sort of ON ERROR GOTO SomeErrorLabel. That error label should display an error message and end with "RUN" instead of "RESUME". This would restart the "application" BAS file and reset the stack.

I use this in the File Utility I'm writing and it works surprisingly well even in it's brute-ness. Keeping the menu/game separate from the title screen would cause the stack space errors to just display an error and restart the user to the menu instead of the start of the game.

I guess for a quick fix, restarting the whole thing would be okay.

I think I'm going to try this and if it works, I'll release a WRY MONO 1.1. (Not sure if the error handler can catch stack space errors though... if not, this won't work obviously)

Edit: Nope, didn't work... unless the "ON ERROR GOTO ErrorHandler" line needs to be in every sub.
Edit2: Did a find/replace on CLS and made it CLS : ON ERROR GOTO ErrorHandler so that it would be everywhere and in every sub. Still didn't work. Looks like QB error handler can't catch stack space errors. Oh well. I guess it needs to be fixed correctly. haha

    • The CLEAR command clears out the stack and any variables and starts fresh. It would fix any stack space errors *IF* if could be called from subs/functions but it can't. It can only be called from the source module. I could set the stack space larger at start up to delay it further using it th... more
    • An interesting solution.... - Puckdropper, Fri Jun 12 2020 5:42pm
      Yeah, Wry will just have to be fixed properly. Or maybe you can set a GLOBAL that tells which menu to load then END SUB/EXIT the whole way back? Kinda like walking a tree? Or expand the stack space in CONFIG.SYS?
      • Never tried the config.sys idea... - Erik_, Thu Jun 18 2020 2:41pm
        Does that work in QB? I should give that a try. Not sure I'd use it as a fix but would be cool to see it in action. I don't think you can pass a variable to a CALL or GOTO command. It will probably say "Subroutine or Label not defined" or something. I wonder about a global stack count variabl... more
        • Stacks=9,256 I think is the line... - Puckdropper, Fri Jun 19 2020 1:12am
          It'll work in QB because the stack is a system thing. What variables do you need to pass in Wry? I guess you could have a global and not worry about passing variables. (Globals are under used at times, IMO. If you're referring to an variable in almost every procedure maybe it should be globa... more
          • the Qbasic stack error. For some reason I always thought it was it's own stack error and the config.sys stack was for something else. Learn something new every day! The variable would be for which screen to go to. I took that as have a global string that held the sub name of what to call next. ... more
            • Why not have the parser flag where extra stuff exists? - Puckdropper, Mon Jun 22 2020 4:57am
              Basically make you a map. "IGNORING STATEMENT AT LINE 239." You then look at line 239 and it will tell you what sub it's in and where and you can add it back in. Ok, so you might have to add a "page id" variable or something and have a long IF..ELSE IF chain (Um... QB had something like SELECT ... more
              • SELECT CASE exists and that definitely could work. - Erik_, Sun Oct 25 2020 1:06am
                Might be easier to just manually take note where the secrets are and add them into the generated source code afterwards instead of having the parser do it. There aren't too many actually. The biggest thing is the invalid selection text but even then a good chunk of them are "YOU MAMA". Wry HTML... more
                • Sometimes that's the easiest way... - Puckdropper, Mon Oct 26 2020 11:51pm
                  If you think you'll rerun the parser many times, then it's worth adding the logic to add in those special cases. I love the snow on Wry HTML. :-) It snowed today here but wasn't pretty and was just a rain snow mix. :-(
                  • I mean, the whole parser app is sort of absurd. - Erik_, Fri Oct 30 2020 6:06pm
                    The amount of effort that went in to parse a single Qbasic BAS file into different output writers was silly but a fun thing to work on. Creating the data files for Wry COBOL by hand would have been much less effort and probably quicker but zero fun. (Honestly, I probably would have never finishe... more
                    • "We don't do these things because they're easy... but becaus - Puckdropper, Mon Nov 02 2020 1:25am
                      e they're fun." Some president misquoted somewhere. Wait, so you can use a buggy QBASIC source as input to your parser to write a not very buggy QBASIC program? That's like Donald Knuth levels of computer science there!
                      • Sure can. Can also make it more buggy if needed! - Erik_, Mon Nov 02 2020 1:44am
                        Just need to add a class implementation for a Qbasic data writer to the parser project.
                        • Yes, please add more bugs! - Puckdropper, Mon Nov 02 2020 4:06pm
                          Get on a regular release cycle where your parser fixes some bugs, adds a few new ones and you update every 2-4 weeks. Just like every Android app out there, even the ones that should be technically finished! (How many updates does a sliding tile game need?)
                          • Agile at it's finest. - Erik_, Sun Nov 08 2020 2:27am
                            Should have a release at the end of every 2 week sprint. Thankfully at my job being a 20+ year old server side system we're not tied to that. They tried getting us to follow the agile flow to the "T" when it was first introduced to the company. We all had to go to a two day training session which... more
  • Click here to receive daily updates
    "Forces act when not restrained" - Puckdropper