04-12-2025, 11:56 AM
I have found when I just want a program to do something, like scan for certain strings in files, that QB64 tends to be my "go to" language for that purpose. I know several different languages, mostly ones I've learned over the years, like Pascal, but it's a bit too formal for what I'm trying to do, which is often to search a line for a specific string, then target points to extract and massage.
One example: I found a list on Wikimedia Commons of tiles (small SVG images that can be pushed together) that can be used to construct railway diagrams, such as subway maps. The file shows all of the tiles and what they look like to know the name of the tile to use. The included links are not for the actual image files, but to the public name. To get that, you have to read the HTML file that is the page for that image, and obtain the actual file name. Take one: File:BSicon_ekKRZr+1o.svg. This is an image of a primary rail line as a vertical dark red line, on a bridge over a secvondary rail line that runs horizontal to it, and curves left to right in an upward direction. These tiles would work quite well for drawing rail maps in a game, as they are public domain (because they explicitly say they are). But that name above is not its "real" name, e.g. https://commons.wikimedia.org/File:BSicon_ekKRZr+1o.svg; no, that's the display name; the actual file is https://upload.wikimedia.org/wikipedia/c...r%2B1o.svg. But to find that you have to read the display page, in order to get the internal file name. It's a lot like screen scraping, only done off-line, (to be polite).
For a dozen or so files, manually downloading them is fine, but in this case, there are over 2,000 images! (There are lots of things to describe in rail maps, I guess.) So I download the index, extract all the display names, then extract each of these, search for the text indicating the internal name, collect and save that, then once that is done, collect the actual files. Doing it manually would take weeks, using a few small programs means it only takes a few hours.
I'm sure there are other languages (like Python) or tools (like AWK) that can do pattern matching, but I just don't feel like learning another language for a small project I can solve in minutes. I'm also not doing this for "production work," for that I'd probably use a more formal language, like Pascal, or C.
There is also an advantage of using a programming language instead of a tool, in that you have more decision and analysis capacity. Also, some programs have value to reuse as a "template" or starter for a different program to do something else.
But I still find QB64 very useful for rapidly writing programs to solve smaller problems. For larger ones requiring more formal work, then I might switch to a more formal language.
One example: I found a list on Wikimedia Commons of tiles (small SVG images that can be pushed together) that can be used to construct railway diagrams, such as subway maps. The file shows all of the tiles and what they look like to know the name of the tile to use. The included links are not for the actual image files, but to the public name. To get that, you have to read the HTML file that is the page for that image, and obtain the actual file name. Take one: File:BSicon_ekKRZr+1o.svg. This is an image of a primary rail line as a vertical dark red line, on a bridge over a secvondary rail line that runs horizontal to it, and curves left to right in an upward direction. These tiles would work quite well for drawing rail maps in a game, as they are public domain (because they explicitly say they are). But that name above is not its "real" name, e.g. https://commons.wikimedia.org/File:BSicon_ekKRZr+1o.svg; no, that's the display name; the actual file is https://upload.wikimedia.org/wikipedia/c...r%2B1o.svg. But to find that you have to read the display page, in order to get the internal file name. It's a lot like screen scraping, only done off-line, (to be polite).
For a dozen or so files, manually downloading them is fine, but in this case, there are over 2,000 images! (There are lots of things to describe in rail maps, I guess.) So I download the index, extract all the display names, then extract each of these, search for the text indicating the internal name, collect and save that, then once that is done, collect the actual files. Doing it manually would take weeks, using a few small programs means it only takes a few hours.
I'm sure there are other languages (like Python) or tools (like AWK) that can do pattern matching, but I just don't feel like learning another language for a small project I can solve in minutes. I'm also not doing this for "production work," for that I'd probably use a more formal language, like Pascal, or C.
There is also an advantage of using a programming language instead of a tool, in that you have more decision and analysis capacity. Also, some programs have value to reuse as a "template" or starter for a different program to do something else.
But I still find QB64 very useful for rapidly writing programs to solve smaller problems. For larger ones requiring more formal work, then I might switch to a more formal language.
While 1
Fix Bugs
report all bugs fixed
receive bug report
end while
Fix Bugs
report all bugs fixed
receive bug report
end while