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 ... 14
1
QB64 Discussion / Re: _FileExists not working with wildcards
« on: April 15, 2022, 02:00:29 am »
Luke, I understand what you are saying, but in my particular use scenario, those concerns will never apply. I will ALWAYS have sufficient permission to delete those files, and it is 100% guaranteed that nothing else will remove the file.

But I do still understand and appreciate your point.

2
QB64 Discussion / Re: _FileExists not working with wildcards
« on: April 14, 2022, 02:51:20 pm »
Thanks for the suggestions. My example was simplified. The actual files in questions and not straight incrementing serial numbers. They actually contain a version number. Here is an example:

WIM_TOOLS_5.1.1.100.txt

I just tried my little fake file idea, and it works perfectly.

Funny, I was stumped by this for 2 hours. 2 minutes after I posted my question that idea spring into my head.

3
QB64 Discussion / Re: _FileExists not working with wildcards
« on: April 14, 2022, 02:39:32 pm »
Actually, I think that I just figured out a little kludge of a workaround.

Before executing the kill command, simply create a fake file called Trash0.txt. That guarantees a file of the format Trash*.txt exists and that will prevent the kill command from throwing an error.

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



5
QB64 Discussion / Re: Has $Debug been working well for you?
« on: March 11, 2022, 07:21:24 pm »
Personally, I absolutely love the debug features. I have a program I've written that is over 11,000 lines at this point and every once in a while, tracking a problem is a royal pain in the backside. This has made my life much easier.

6
LOL. I actually used the word LIMIT in the title of my question.

I amuse myself sometimes :-)

Thanks!

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


8
Thanks for the responses. Much appreciated.

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

10
I can't believe how much misinformation there is on this topic.

First, I might note that the opinions I'm expressing comes from someone with 12+ years experience specifically working with storage hardware for a major NAS / SAN company.

Let me start very simply: These ideas that all kinds of things need to be moved off an SSD are utter nonsense. That's old school thinking from before the times where the OS is SSD aware. This whole paranoia over rapid wear of an SSD is simply overblown. Even cheap consumer SSDs are highly unlikely to exceed their usage specs within 5 years.

Let's take a simple example:

I have a Seagate Firecuda 520 2TB SSD with a TBW (TeraBytes Written) rating of 3,600. Let's say I want to ensure that I get a 5 year lifespan out of this drive. This would mean that I could write 1.97 TB of data to that drive EVERY SINGLE DAY for 5 years. I don't know about you, but I don't often write that much data to a drive in a day.

Let's assume I had a 1TB SSD. That would cut the TBW rating in half which would allow for 0.98 TB written every single day for 5 years. That's still a tremendous amount of data.

As for the OS itself, any modern OS is very much SSD aware and has strategies to avoid excessive writes to the SSD. Of course, if you over tax a system, for example, trying to perform heavy video editing tasks on a system with only 4GB of RAM, you are going to force the system to utilize paging a lot more often. Spec out a system with reasonable amounts of RAM for the tasks you plan to undertake, and you might be surprised how little data gets passed through the paging system.

I'm sure that many of you have laptops that have no spinning disks, only SSDs. Have ANY of you ever actually exceeded the TBW rating of your SSD in 5 years or even 10 years???

I'm going to admit something: I was once paranoid about the short lifespans of SSDs myself. But with the advent of modern operating systems and the knowledge gained having to deal with these issues on a professional level, I now hammer away on my SSDs with reckless abandon :-)

Do I still use fixed platter HDDs? Sure. I have a media library in excess of 40TB so large fixed platter HDDs are perfect for that only because of their far better pricing for large drives, however, I may re-evaluate that soon as 8TB SSDs are starting to creep down in price.



11
QB64 Discussion / Re: QB64 v2.0 released! ⭐️⭐️⭐️⭐️⭐️
« on: October 10, 2021, 10:58:57 am »
Thanks for the effort put into this. This is truly a worthwhile major new release!

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

13
I'm doing some major additions to some of my code and the $Debug functionality is really helping tremendously. I've even found some unexpected ways that it's helping. As an example, I have a lot of variables that I juggle. Since my code does things like partition and format flash drives, I deal with partitions a lot. I have lots of variables like ParSize, ParType, TotalPartitions, ParDescription, and lots more. Sometimes, I can't recall the exact name of a variable I want to use so I must put an index mark where I'm working, then go fishing through my code to find the right variable name, then come back to where I was working. With debug, I simply hit F4 and in the filter box just start typing (P-A-R) and bingo! There are all the variables I want. So now I found what I'm looking for without ever moving off my current line of code.

I also like to do some fine-tuning as I go along. So, I'll run my code, look at the output, and if I see something like a text message that could be re-worded or a menu that doesn't look good, I stop execution and fix that little piece right then and there. So, there is a lot of run, fix, run fix, etc. Being able to keep my variable watches without having to recreate them every time really helps in such a repeating cycle type of flow.

Thanks! I'm really having <gasp> FUN with my amateur coding right now.

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

15
Fellippe, that did indeed fix it! I can't believe how quickly you fixed that.

This is fantastic.  Thank you so much. Can't believe how fun this is making programming for a novice like me.

Pages: [1] 2 3 ... 14