This reverts commit a94b738407.
It turns out that change stops the SHELL function returning the
child exit code, which is worse than having zombie processes.
This change adds the Program Files and Program Files (x86) folder specifications to the `_DIR$()` function.
`Print _Dir$("program files")
Print _Dir$("program files x86")`
Where the previous bug would only return the console's image size when an image was passed, the new bug made it only ever return 80 for `_Width` and 25 for `_Height` when it should be returning the console's image size if there is no value passed and it is the `_Source`, which it is if we are in a `$Console:Only`.
Here is a code block that demonstrates the bug being fixed:
```Option _Explicit
$Console
Screen _NewImage(640, 480, 32)
_Dest _Console
Width 120, 5
_Dest 0
Print "Hello world"
Print _DesktopWidth, _DesktopHeight
Dim As Long i: i = _NewImage(1280, 720, 32)
Print _Width, _Height
Print _Width(0), _Height(0)
Print _Width(_Console), _Height(_Console)```
When opening a file for random access, if the LEN is not supplied, it defaults the length correctly, but does not allocate the buffer correctly. The code should reference the record_length in the file struct.
The processing for MKDMBF$ fails for numbers smaller than 1. Basic cause is the check for exponent overflow is incorrect. Changed code to correctly check for exponent overflow
2 changes here:
line 13062: When opening a file for random access, if the LEN is not supplied, it defaults the length correctly, but does not allocate the buffer correctly. The code should reference the record_length in the file struct.
Changes in lines 15798-15853: When printing text to the screen, carriage returns in the text are ignored. In sub_file_print, the code for printing to the screen is modified to honor carriage returns.
Fixes a bug that would make QB64 return the incorrect size monitor/desktop size when the resolution is scaled. Also, the last fix I added that set `_Source` to `_Console` automatically caused an issue with `_Width` and `_Height`, causing them to return only the console's image dimensions rather than the image that is passed.
Done for the sake of retrocompatibility. Although those symbols are simply ignored, as the type is determined by the variable types given at the respective READ statements.
Before we strip off the requirements (like "monospace" and such), we should first see if the font exists on the drive, since we call the routine recursively looking for it.
If a user has Homebrew installed, calling g++ won't use Apple's Xcode version of the tool, which is required by QB64. This fix continues on with the patch introduced in 4dbdddc89e.
Extra "osx" references replaced with "macOS", but nothing substantial (almost aesthetic).
Fixed an issue where Apple's Clang is forcefully used instead of GCC for compiling QB64 applications. (Fixes issues for those using true GCC via Homebrew and not Clang that just has a symlink of GCC).
- Changes CFont to sub__consolefont and func_CInp to func_cinp, in alignment with the rest of libqb/qbx.
- Adds stubs to all new console functionality, so we can still ship for other OSes with no bigger issues.
- Adds new keywords to syntax highlighter.
Aditonal to VAL, the &B prefixed numbers are now also recognized by INPUT (keyboard and file input) and also by READ, if those numbers are noted in DATA statements.
CFont uses a few function calls which aren't supported by anything older than Windows Vista, while QB64 otherwise works all the way back to Windows XP. Since there's no desire to make us lose functionality with older systems and obsolute them to oblivion, the code has been commented out and replaced with a stub as default. Users of older machines can simply use it "as is", as can folks who don't care about console functionality. Users with versions of Windows from Vista up, can simply uncomment the code (comment out the placeholder stub), and then purge libqb so we automatically rebuild our library to make use of the routine.
It seemed the easiest way to keep it in there, more or less, so that people who wanted to use it can, while not bothering the rest of the user base. There just needs to be a short note wrote up in the documention on how to "enable the command", but it's not a hard process (uncomment a few lines, comment a few others, and run a batch file -- if a programmer can't handle that much, then they don't need the command to start with...).
Window's CONSOLE support has been extended so that:
CSRLIN support added.
POS(0) support added.
LOCATE support added. (Works with optional parameters.)
COLOR support added.
SCREEN support added to get both character and color information of any point on the console.
tab() glitch fixed. (Which could cause an endless loop when printing with comma spaced text/numbers.)
_WIDTH support added.
_HEIGHT support added.
WIDTH support added, with 2 new parameters added so we can set the buffer width and buffer height also.
CLS support semi-added. (Doesn't accept colored backgrounds; it clears the screen black. I'm getting tired of working up console stuff which I probably won't ever use myself...)
SLEEP support added.
END support added so we now end with any keypress and not just enter.
_CONSOLEINPUT added, so we can tell the difference in mouse and keyboard input.
_CINP(toggle) support added, which allows us to get single character keystrokes from the console.
_CONSOLEFONT FontName, FontSize support added, which allows us to change the font and font size we use for the console.
_CONSOLECURSOR _SHOW|_HIDE, cursorsize support added, which allows us to show or hide the cursor in the console, and to change its size (from 0 to 100), as desired.
New keyboard commands added:
_CAPSLOCK -- returns 1 if caps lock is on, 0 if it isn't.
_NUMLOCK -- as above, but for num lock
_SCROLLOCK -- as above, but for scroll lock
_TOGGLE_CAPSLOCK -- toggles the caps lock state for us.
_TOGGLE_NUMLOCK -- same, but for num lock
_TOGGLE_SCROLLOCK -- same, but for scroll lock
Two new keywords added:
FUNCTION _INFLATE$ (text$)
FUNCTION _DEFLATE$ (text$)
Use of these commands can compress and decompress strings using the ZLIB library.