ramidavis Posted November 12, 2017 Share Posted November 12, 2017 I wish there was a way to use GOTO to jump to a specific part of a line.What i mean is, instead of starting with the first command on a line, i wish i could jump past the first (or second, or third etc.) '::'.For instance,100 COMMAND#1::COMMAND#2::COMMAND#3::COMMAND#4Lets say i wanted to jump line 100, but did not want COMMAND#1 to execute.I would have to write the line as multiple lines, moving COMMAND#1 to a different line.But lets just suppose there was a way to do what i want.I imagine it looking something like this:GOTO ;1 100The ; and number following it indicate how far into the target line to jump.Omit it to use GOTO / GOSUB as normal, or specify the number of '::' to be skipped in the target line using ;# syntax (;# could also be a variable like "GOTO ;X 100" where X=2).Perhaps a future version of RXB could implement something like this? Quote Link to comment Share on other sites More sharing options...
+mizapf Posted November 12, 2017 Share Posted November 12, 2017 Has anybody done a performance review of multiple BASIC statements per line? When I read some of my old BASIC programs, I always wonder why I tried to squeeze that many commands in a single line. Maybe just because I could do it. But it was almost never good for readability. (I admit this is the typical overbearing response in forums, asking whether you actually want that. :-) ) Quote Link to comment Share on other sites More sharing options...
ramidavis Posted November 13, 2017 Author Share Posted November 13, 2017 (edited) I don't see how this could be anymore of a problem then QBasic's goto labels. So yes, i actually do want this. (That or someone to port QBasic to TI.) Edited November 13, 2017 by ramidavis Quote Link to comment Share on other sites More sharing options...
RXB Posted November 13, 2017 Share Posted November 13, 2017 This is just really asking for BAD PROGRAMMING on purpose. The main argument against spaghetti code is the GOTO and JUMP in Assembly or JMP in GPL. This is the reason for XB use of GOSUB and CALL NAMEHERE so this creates more efficient and better designed code. Which is why GPL has BL or CALL and Assembly has BL and BLWP in the first place. Now agreed line numbers in Basic and XB are a pain but labels in general are no that much better as sequence is much harder to follow with labels vs line numbers. Labels are more convenient to remember then line numbers which is why they are prefered but for human programmers, but at the computers point of view is totally non binary. This is especially true for labels like DSBGYT as only the original programmer know what this stands for, vs 17845 as a line number. (Both are hard to remember) As for multiple code in a XB line you are not forced to use them and could be taken apart so each command or a few command can be on a line. The reason to abandon spaghetti code by programmers started shortly after ADA language was invented, going back would be a really bad design computer science wise. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.