Posts: 2,181
Threads: 222
Joined: Apr 2022
Reputation:
104
04-03-2024, 10:40 PM
(This post was last modified: 04-03-2024, 10:55 PM by Pete.)
Ever consider adding _SAVE and _SAVEAS? I was thinking today (shut up Steve) that since someone changed the IDE save function to a more Windows type look, it might be fairly easy to code these nice features and add them to our keywords, much like the _InputBox feature.
I figure as long as we never lose our BASIC buildings blocks, to be able to build these functions from scratch, additions like this can't hurt the language and they might make the language more attractive to new users.
Oh, and as a side note, did you folks know the IDE cannot correctly save a program with certain control characters enclosed in quotes? Easy enough to work around that by making the string as CHR(0) + CHR$(1)... etc. Anyway, just thought I'd bring it up in case anyone has the time to look into it, after you're done poking fun at Steve's code while on Discord.
Pete
Posts: 2,181
Threads: 222
Joined: Apr 2022
Reputation:
104
Hey that was fast!
_SAVEFILEDIALOG$
Next time I'll look in the Wiki, first. A lot got done in the year I was out.
Pete
Shoot first and shoot people who ask questions, later.
Posts: 200
Threads: 13
Joined: Apr 2022
Reputation:
52
(04-03-2024, 10:53 PM)Pete Wrote: Hey that was fast!
_SAVEFILEDIALOG$
Next time I'll look in the Wiki, first. A lot got done in the year I was out.
Pete
Ooohh yes, lots of things were improved and added.
You were away since Dec/22, so I'd recommend not only looking into the Wiki, but also have a look on our release notes at GitHub and work down through it til v3.5.0, which came in Jan/23.
Posts: 2,181
Threads: 222
Joined: Apr 2022
Reputation:
104
Posts: 2,696
Threads: 328
Joined: Apr 2022
Reputation:
217
A Highlight of Steve's Favorite Features of the Last Year(tm)!!
Quote:#46, #98, #250, #265, #272 - Added support for opening HTTP and HTTPS requests using _OPENCLIENT(). - @mkilgore
Feature is current unstable and requires $Unstable:Http to use.
On Linux and Mac OS this functionality requires libcurl to be installed.
HTTP(s) connections are opened using _OPENCLIENT() and generally work the same as the existing TCP/IP streams.
See the Wiki page on Downloading Files to see a complete overview of this functionality.
#286 - Added support for opening image from memory using _LOADIMAGE() - @a740g, @mkilgore
_LOADIMAGE() has a new optional requirements$ argument, similar to the string argument to _SNDOPEN():
_LOADIMAGE(fileName$[, [mode&][, requirements$]]).
#232, #330, #335 - Added a new _LoadFont() argument which allows loading a font from memory - @a740g
#315, #319, #327 - Implemented a new "Code Export" feature reachable via the "File" menu. - @RhoSigma-QB64
Useful for authors of tutorials, documentations or Wiki pages, they can now easily export the currently edited code and insert it in their work. The code is highlighted according to the currently chosen color scheme in the IDE and the keywords are linked to its respective Wiki pages.
Export is possible as Hypertext (.html), Rich Text (.rtf) or Wiki encoded text (.txt).
#188, #330, #335 - Added commands for rendering Unicode text - @a740g
_UPrintString acts like regular _PrintString but accepts Unicode strings.
_UFontHeight gives the global glyph height of a given font, which may be larger than the _FontHeight. _UPrintString uses this height.
_UPrintWidth acts like _PrintWidth and returns the width in pixels a Unicode string will take up when printed using _UPrintString.
_ULineSpacing will give the proper vertical spacing (font height + extra pixels) to vertically separate multiple lines of text.
Adds the _SAVEIMAGE fileName$[, imageHandle&][, requirements$] statement
It can save graphics and text screens / images as PNG, QOI, BMP, TGA, JPG and HDR
#414, #415 - Implemented $EMBED metacommand and _EMBEDDED$ function. - @RhoSigma-QB64
Can be used to embed any files (images, sounds, fonts and other assets) into the compiled executable and recall it in the program when needed.
#419 - Filesystem refactor and update - @a740g
Added _FILES$ to read file and directory names programmatically.
Added _FULLPATH$ to get an absolute or full path name for a specified relative path name.
_DIR$ now works as expected on Linux & macOS.
FILES now works on Linux & macOS.
KILL now supports deleting files on Linux & macOS using wildcards.
CHR$() and ASC() can now be used in CONST expressions.
#454 - Implemented the _READFILE$ and _WRITEFILE commands - @RhoSigma-QB64
These functions will read/write whole files without OPEN/CLOSE overhead, hence similar to BLOAD/BSAVE
#444, #447 - Implemented new checksum and hashing functions. - @RhoSigma-QB64
Added _ADLER32, _CRC32 and _MD5$.
Posts: 2,181
Threads: 222
Joined: Apr 2022
Reputation:
104
First I need to build a bigger sand box to play around with all this great new stuff!
Pete
Posts: 2,181
Threads: 222
Joined: Apr 2022
Reputation:
104
04-04-2024, 12:08 AM
(This post was last modified: 04-04-2024, 12:09 AM by Pete.)
Quit laughing Fell, I see you!
Pete
Shoot first and shoot people who ask questions, later.
Posts: 67
Threads: 18
Joined: Aug 2022
Reputation:
12
(04-03-2024, 10:40 PM)Pete Wrote: IOh, and as a side note, did you folks know the IDE cannot correctly save a program with certain control characters enclosed in quotes? Easy enough to work around that by making the string as CHR(0) + CHR$(1)... etc. Anyway, just thought I'd bring it up in case anyone has the time to look into it, after you're done poking fun at Steve's code while on Discord. The reason is simple. Windows uses the Unicode compliant UTF-8 (Read The article on Wikipedia) for file names and file contents. QB64pe is essentially a Dos program running as ASCII only. UTF-8 is exactly the same as ASCII, for CHR$(0) thru CHR$(127). For the characters above 127, it uses an encoding system where a character in the range 128 to about 40,000 is translated into a 2, 3, or 4 character value. So when characters above 128 appear, Windows can't use them because it does not support Unicode in that form. We are using the "A-form" Windows system calls, e.g. GetOpenFileNameA rather than GetOpenFileNameW, so the characters display as ASCII values, not Unicode.
So that's one possible reason. It may not be the only one.
While 1
Fix Bugs
report all bugs fixed
receive bug report
end while
Posts: 2,181
Threads: 222
Joined: Apr 2022
Reputation:
104
It can save strings with characters above 127 like 128, 129, and 130. The rest I didn't test. It has a problem with chr$(10) the end of line character. Insert it in quotes with a PRINT statement. It can be saved, but when you open the file, it won't be present. The IDE does issue a warning that the IDE may not act as expected if characters 1-32 are used. Of course we have _CONTROLCHR OFF to help with running a program with these lower ASCII control characters, but that won't help when saving the file. Some control characters like CHR$(10) cannot be saved as a glyph, you have to use PRINT CHR$(10) to get the IDE to save it correctly.
Pete
Shoot first and shoot people who ask questions, later.
Posts: 730
Threads: 30
Joined: Apr 2022
Reputation:
43
What would be the point of needing those other characters in a file name?
Tread on those who tread on you
|