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.


Topics - hanness

Pages: [1] 2 3 ... 5
1
QB64 Discussion / _FileExists not working with wildcards
« on: April 14, 2022, 02:25:08 pm »
I'm having a problem with _FileExists. It seems like this function does not handle wildcards.

My goal here is to see if there are any files in the same folder where the program is located named Trash1,txt, Trash2.txt, Trash3.txt, etc.

Take this as an example:

If _FileExists("Trash*.txt") Then
    Kill "Trash*.txt"
End If

The above program would fail to delete those files because _FileExists appears to be unable to handle wildcards.

If I would run the kill command by itself, it would successfully delete those files. However if there are no files named Trash*.txt, then the kill command would cause a failure in the program so I have no choice but to determine if any files named Trash*.txt exist first and that is what the "if" statement is supposed to do.

Since _FileExists won't work for this, can anyone suggest a workaround for me?



2
QB64 Discussion / Please remind what the command to limit loop frequency is
« on: February 13, 2022, 05:02:50 pm »
For the life of me I simply cannot recall or find what this command is.

There is a command that limits how many iterations of a loop are run every second. For example, if you have a Do ... Loop, you could set it to run this loop no more than 10 times per second to avoid using unnecessary resources.


3
I have a QB64 program that can take several hours to run. Is there anything that I can put in the code to prevent Windows from going to sleep while the program is running?

I don't want to have to modify my sleep settings every time I run the program. My preference would be to simply have some sort of code within the program that tells Windows not to go to sleep until told otherwise.

4
It makes sense that focus would shift from the IDE to my program when an Input statement is encountered, but I find that when I read from a file using Input$ the focus also shifts. Is this expected behavior for some reason?

Here is a sample clip. Simple step through the code line by line and note that the line "Temp$ = Input$(FileLength, 1)" will cause focus to shift to the console. Same thing happens when a console window is used.



   
Code: QB64: [Select]
  1. $Debug
  2.  
  3. Dim FileLength As Long
  4.  
  5. Open "QBTEST.TXT" For Output As #1
  6. Print #1, "blah, blah, blah"
  7.  
  8. Open "QBTEST.TXT" For Input As #1
  9. FileLength = LOF(1)
  10. Temp$ = Input$(FileLength, 1)
  11.  
  12. Print "Focus should still be on the IDE at this point"
  13. Print "This is the end of the test"
  14.    

5
QB64 Discussion / $Debug Feature Suggestion
« on: September 30, 2021, 11:51:12 pm »
If there is one thing that I learned from repeated test compiles and debug sessions tonight, it's that it is tedious as heck putting the watch variables over and over again each time I make a change to the code. Don't get me wrong, it's well worth the effort, but how about this...

How about once I enter all the variables to watch, having a way to export those to a file. Then, the next time I run the program, I could import that same list. I can then add to or remove from that list of variables to watch, but I have a starting point so that I don't need to manually select every variable over and over and over.

Is that something that would be doable, eventually?

6
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?

7
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 ]  

8
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?

9
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.

10
QB64 Discussion / Feature Request Related to the Current $Debug Work
« on: September 25, 2021, 04:36:53 pm »
When saving a program, index marks get saved so that the next time I reload the program, these index markers are available.

Likewise, it would be fantastic if breakpoints, active variable watches and variable watchpoints were saved as well. Basically, any work in progress including these debug settings would be nice to save so that they are ready to go again when the program is loaded the next time.

11
QB64 Discussion / Is it possible to lock the console size?
« on: September 24, 2021, 12:48:06 pm »
I have a program that runs entirely in a console windows. All input and output happens within that console window. Is it possible to prevent a user from resizing that window? It appears that the $RESIZE:OFF metacommand does not work with the console window.

12
I'm working on a QB64 program that uses only a console Window but it appears that Inkey$ does not function in a console window. Is there any trick that I can use to make this work?

13
I noticed that if I post a QB64 program to GitHub, GitHub indicates that the program is a FreeBasic program. Anyone know if there is a way to change this to accurately display as QB64?

I'm brand new on GitHub so I'm just now trying to figure out little stuff like this.

14
Is it possible to have output from a QB64 program that normally goes to a console window be directed to a Windows Terminal console (CMD) window?

15
I have program that displays information to the user and gets input from the user entirely in a console window. There is a lot of data that gets collected from the user, requiring a good amount of typing. However, I have noticed that if I place all the responses to the program in notepad and then copy / paste to the console window, all my responses will be buffered and played back into the program from the keyboard buffer.

This has me wondering: Is there a way to inject data into the keyboard buffer from within a QB64 program?

Pages: [1] 2 3 ... 5