Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hanness

Pages: 1 [2] 3 4 ... 14
16
!!! I found it !!!!

So the problem is that I have a number of variables for which I perform a ReDim but I never have an original DIM statement.

In my code, this works just fine, but apparently Debug does not like this.

I simply placed a "Dim PartitionSize(0) as String" near the start of my code with all the other DIM statements and the problem is solved.

The problem is that I think I do this with a bunch of variables so I need to look at every single ReDim in my 13,000 lines.

So, the logical question: Should what I am doing (ReDim without a preceeding Dim) ne valid or not?

17
Another data point. Whether this helps or not, I don't know.

So, the line where it is failing, that reads "TotalPartitions = 0"...

If I comment that line out it will fail on the very next line. So clearly, it is not precisely that line that causes the issue. However, that happens to be the first thing that is executed after jumping to the label called "Boot_MultipleMode" which is more than 1,000 from the point of origin. I wouldn't think that should matter, but thought I would mention it.

Also, I did consider that having an underscore in the label name might be a problem so I changed that, but it makes no difference.

18
Pete, that actually made it worse. It gives me a subscript out of range right on the line where the breakpoint was set.

That is actually a recurring theme now. If I do not set a breakpoint, no error. The code runs fine.

If I set a breakpoint where I noted in my repro, then it fails a few lines later at the line that reads "TotalPartitions = 0 ".

If I set a breakpoint AFTER that line, the code will run fine up until that breakpoint but immediately fail when it hits that breakpoint.

So it seems to me that the line "TotalPartitions = 0 " is a key to this, BUT, it only causes a subscript out of range when in debug mode by stepping to it with F7 or by setting a breakpoint on or after that line.

19
I was wrong. Same problem. I had found another location in my code where I mixed up thse two variables. Also had a Source$ and a Source$ array so I changed the array to a different name. Neither made any difference, however. Just can't wrap my head around this one.

20
Okay, hold off looking at this. I think I found my problem. Just wanted to shout before I wasted more of your time. I should have confirmation in a couple minutes.

21
Spelling error in my post. The variable to watch is PartitionSize.

22
Thank you. I appreciate you taking an interest in this.

Running build 1e67962 on Windows 11.

I'll attach the code as a ZIP file! Fortunately, because I'm focusing on a new section of code I put in some test code to simply bypass huge chunks of code and take me to the portion that is my current focus so really very little code is run at this point.

The code has to run elevated, so to make that work with QB64, I have run QB64 as admin.

Here are the steps to repro:

Set a breakpoint on line 3883. This line reads: If Temp$ = "H" Then

Run the program (F5). Make sure that QB64 is being run elevated.

On your system, you may get a warning that the Windows ADK is not installed (not sure if you will or if I am bypassing that section). The program requires this for some operations but for this test it won't matter. Just continue if you do get such a warning.

You will get just a few questions before the breakpoint. Here are the answers and responses to supply:


Q: For this project, should we exclude the autounattend.xml answer file if it exists?
A: Y

Q: Do you want to inject an EI.CFG file into your final image?
A: Y

Q: Single, Multiple, or Help: ?
A: M

You are now at the breakpoint. Press F7 a few times. You only need to go as far as the line of code that reads

TotalPartitions = 0

Go a line or two past that and note that all is well.

Stop the program.

Set a watch for "PartitionSize" specifying indices 1-2.

Perform the exact same steps as above. As soon as you hit the "TotalPartition = 0" you should get a subscript out of range.

  [ You are not allowed to view this attachment ]  



23
I'm building a framework for some new code in one of my existing programs. I wanted to use debug to take a look at the values in several variables, including a few arrays.

In this section of code I use an array called ParSize using LONG as the type. In a completely different section of code I have another array called PartitionSize as a type of STRING.

In using debug, I accidentally started monitoring the PartitionSize array but was really after ParSize.

Now here is the weird part:

If I run the program normally, I have no problems. But when I set a break point and step through the code line by line using F7, I keep getting a subscript out of range error. It happens only if I am monitoring that PartitionSize array. Also, nowhere in the code that is being executed is that variable ever touched (as far as I can tell) other that the original DIM statement near the start of my program.

Is there any way that someone could provide me ideas on the types of things to look for to figure out what is happening?

24
Pete, sorry, missed your post initially. Actually, it is when clicking the maximize button that the problem happens. It does not happen when dragging the corners as was suggested.

25
Huh! That was simple solution. Manually sizing the window solved the issue.

I should have pointed out that I am actually currently running Win 11 (hey, we're 5 days from final initial release) so the issue is still present there, but I'm very happy with this solution and clear explanation of what is happening.

Doing some major updates to my 13,000+ lines of code right and have to say that the debug stuff is making me happier than a pig in slop!

Thanks again for help, gentlemen!

26
I've always just sort of lived with this but I thought that I would inquire to see if there was any sort of setting somewhere that can affect this.

I notice that in the IDE the item selected or highlighted is well below the position of the mouse pointer. Take a look at the screenshot below. You can clearly see that the mouse pointer is on the line for "Save" but the IDE thinks that I am pointing to "Save As...".

Any kind of setting to tweak this behavior?

  [ You are not allowed to view this attachment ]  

27
Fantastic. Thanks to both of you. Extremely helpful!

28
I wrote a program that performs a LOT of operations by running Windows command line utilities via SHELL commands. Because of this, I have simply been doing many basic file operations like copying and moving files using SHELL commands along with Windows COPY, MOVE, ROBOCOPY, etc.

However, it just seemed odd to me lately that I'm not seeing equivalent commands for these simple operations in QB64. It's entirely possible that I'm simply missing something. Could someone just tell me if I'm being obtuse here or is running commands like COPY, MOVE, etc. via SHELL the normal way to perform these operations?

29
Thanks for the suggestion. I will give it a try.

30
Sorry, I already had one idea today that I posted earlier, but here is another.

There are times when I open 2 QB64 Windows side by side so that I can compare some existing code from one Window and start making modifications to a copy of the file in the other window. However, there are times where I accidentally started doing code updates in the wrong window. It would be great if there was a toggle to make one window a view only window. That way, if I started trying to type into the wrong window and saw that nothing was happening (or maybe even a beep could play), I would have instant visual feedback that this is my view only window.

Pages: 1 [2] 3 4 ... 14