Posts: 412
Threads: 59
Joined: Apr 2022
Reputation:
14
Not sure I'm seeing it Mr. Naked. And as an aside, I can't believe I posted this image with those damn ads attached to it. How did that happen? Sorry to those you find that annoying as hell.
Posts: 2,830
Threads: 340
Joined: Apr 2022
Reputation:
246
That , 7 is part of the translated code and represents the length of text.
"extreme", 7
^ there's 7 characters in "extreme"
Posts: 1,466
Threads: 58
Joined: Jul 2022
Reputation:
52
12-14-2023, 08:08 PM
(This post was last modified: 12-14-2023, 08:12 PM by mnrvovrfc.)
What happened that the source code couldn't be posted as ordinary "code" block here?
This is because earlier I kept getting a 502 trying to open the screenshot.
YOU CANNOT USE TWO g VARIABLES in consecutively nested FOR/NEXT loops!
I don't know if QB64 would even permit it. But the outer loop will execute once. It's because the inner one will set that variable to 8, then when the processor goes to the outer "FOR" line, for the same exact variable it thinks, "OK it's 1 to 8 but the value is nine so I give up". :O
Actually the IDE doesn't know what to blame because the programmer failed to close a loop. The two variables for "FOR/NEXT" must have different names, and each loop should be closed properly inside the "CASE" and before "END SELECT".
Change one of the g variables of the loop control, then add another "NEXT" at the bottom, before "END SELECT" statement. Without it, the program will not compile.
Posts: 2,830
Threads: 340
Joined: Apr 2022
Reputation:
246
You *can* namr two loops with the same variable name. It's probably not going to work the way you'd expect, but it is perfectly valid.
The problem is the lack of the enclosing NEXT for that first FOR.
Posts: 412
Threads: 59
Joined: Apr 2022
Reputation:
14
Thanks Ted and all. It was like finding Waldo.
On the multiple uses of the g control variable. I do this often to find a letter with some meaning to the array or formula to which the looping is associated. That way I can search for just that letter if I'm getting questionable results from either a formula or a display of values from an array. I also find that a complicated For/Next loop or IF/ ENDIF seems to be slower than breaking the decision up into smaller multiple loops. And MNRV I'm finding, as long as I run the loop to its end (ie no nesting) I can reuse the same control variable name, like g as many times as I want.
Thanks again for the speedy find of my problem (I'm a slow coded and would have found the solution some time after Christmas) and the explanation of the 7.
Still upset with myself for attaching an image with ads. You guys must have ad blockers because every time I click on the image I uploaded I get flashing ads. I'll have to pay attention to how I did this or no more uploading of those dazzling images of my coding.
Posts: 779
Threads: 35
Joined: Apr 2022
Reputation:
52
@Dimster
You can upload an image as an attachment and then use "Insert into post" or something and it will still put it in the body of your post but without the external website.
The noticing will continue