CONST has more options than what the internal math routine itself
handles; it doesn't need to toss an error message whenever those pop up;
just when it's an actual math style message. This fixes that.
An arrow to the left of the line where a variable was defined will be shown after compilation to indicate that variable hasn't been used throughout the program.
When USING follows another print in the same statement (such as PRINT
"123"; USING "###"; 456), it created a memory leak due to the temp
variable being created twice and only freed once. This patch corrects
that issue.
Fix to the precompiler so $IF/$LET work as expected. Adds ability to
see if a precompiler variable is DEFINED or UNDEFINED, to exclude
duplicate code in libraries and such.
Previous wiki software returned html entities instead of actual characters, but the new host has an updated version of mediawiki that does the contrary for some special characters.
- Allows using _DROPPEDFILE as an array ranging from 1 TO _TOTALDROPPEDFILES.
- Using _DROPPEDFILE as an array doesn't reset _TOTALDROPPEDFILES (unlike when reading _DROPPEDFILE$ sequentially with no parameter), so it's necessary to call _FINISHDROP after working with the list of dropped files so it'll be reset.
New statement:
_ACCEPTFILEDROP [{ON|OFF}]
Enables a program to accept files being dropped from a folder.
New functions:
_TOTALDROPPEDFILES
Returns the number of files that have been received via drag/drop.
_DROPPEDFILE$
Returns the list of files that have been dropped. The function sequentially returns the file list and decreases _TOTALDROPPEDFILES with every read.
The statement works as INSTR does but starts from the end of the passed string (or from the specified position) and looks for the passed substring while moving backards.
Takes after VBScript's InStrRev: https://www.w3schools.com/asp/func_instrrev.asp
Closes #51
Existing syntax:
colour~& = _RGB32(red, green, blue)
New possible uses:
- Instead of passing identical rgb values to achieve a shade of gray, pass only 1 parameter for all color components:
colour~& = _RGB32(51) 'same as _RGB32(51, 51, 51)
- _RGB32 can now take an optional alpha parameter, which makes _RGBA32 obsolete (although it still exists for retrocompatibility):
colour~& = _RGB32(255, 0, 255, 30) 'same as _RGBA32(255, 0, 255, 30)
- If you want a shade of gray and also to specify the alpha level, you can pass just two parameters:
colour~& = _RGB32(51, 30) 'same as _RGBA32(51, 51, 51, 30)
In summary:
- 1 parameter = red, green and blue simultaneously set.
- 2 parameters = red, green and blue simultaneously set plus alpha level.
- 3 parameters = red, green and blue as usual.
- 4 parameters = red, green and blue plus alpha level (same as _RGBA32).
Syntax:
_ALLOWFULLSCREEN [{_STRETCH|_SQUAREPIXELS|_OFF|_ALL}][,{_SMOOTH|_OFF|_ALL}]
Existing _FULLSCREEN statement is not bound by _ALLOWFULLSCREEN's settings, only the ALT+ENTER key combo.
_ECHO is more of a macro than a new statement, as it'll perform the following actions:
1- Save current _DEST;
2- Switch to _CONSOLE;
3- Print the passed string (only strings accepted);
4- Switch back to previous _DEST.
None of the PRINT features such as USING, numeric variables, retaining the cursor are implemented/planned for this statement.
Closes #29
Running a compiled program in standard "attached" mode had no real use as it had been planned (as once stated by Galleon) to allow future integration of a debug mode that never came to be. It is not practical as is. This change makes F5 (and consequently the Start option in the Run menu) start the program automatically in "detached" mode (equivalent to Ctrl+F5 in previous versions), which means that the resulting binary will be run with SHELL _DONTWAIT instead of simply SHELL, allowing the newly launched process to be independent from the IDE.
- Adds submenus.
- Renamed "Save EXE in the source folder" to "Output EXE to source folder" in Run menu.
- Changed behavior of disabled menu items; instead of closing the menu, do nothing.
- ShowLineNumbersSeparator will separate the line numbers panel from the main text are with CHR$(179);
- ShowLineNumbersUseBG will use the same color assigned to current line highlight in the line numbers panel.
When an error in an include file is reported, the IDE also shows what line inside the external file caused the error. Double-clicking the include line will open the file in a second instance of the IDE and position the cursor in the line that caused the last error.
- The IDE will wait until the second instance is closed, check if the file was changed and recompile accordingly.
- Interface lights dim while the second instance is being used.
- Fixes CTRL+letter being inserted in the text area even after combos were processed.
- Fixes CTRL+letter activating menu items.
- Fixes a menu being preselected when activated with ALT if the mouse was hovering it (hovering still works *after* the menu is launched)
By unchecking the new switch in the Options menu, the IDE won't warn and "red-light" every single mistake until you tell it to start compilation with F5.
Signed-off-by: FellippeHeitor <fellippeheitor@gmail.com>
- SUBs and FUNCTIONs names will be highlighted throughout the code.
- The same color assigned to metacommands is used for custom keywords.
- A custom dictionary can also be added to internal/config.txt.
- SUBs and FUNCTIONs in $INCLUDEd files also get highlighted, as long as there aren't any errors preventing compilation.
Signed-off-by: FellippeHeitor <fellippeheitor@gmail.com>
Default cursor height for non-insert mode is LOCATE , , , 8, 8. Start and End values can now be customized in the config.txt settings file (values range from 0 to 31).
- Improved number detection (negatives, decimals, trailing type suffixes);
- Properly clear the status area before showing "converting..." message for QB45BIN.
Version 1.1 color schemes contained only 6 colors. This patch allows users to maintain their existing schemes while adding keyword and number highlight colors to them. Also:
- Invalid schemes are now just skipped, instead of destroyed.
- Scheme selection arrows and "Save"/"Erase" buttons are more visible/distinguishable between active/hovered/inactive states.
- Confirmation dialog before erasing user schemes.
Upon attempting to load a binary file, the IDE will detect that the file type is a QuickBASIC 4.5 binary file and offer to convert it to plain text using qarnos's QB45BIN utility.
- Disable resizing when the help system is open and when dialogs are displayed.
- Minor fix to multi-highlighting to also allow it to hightlight instances of the same text seleted in the current line.
When a a single-line selection is made, every instance of the same "word" on the current screen gets highlighted. Can be disabled in Options->IDE colors.
- _WINDOWHANDLE exposes the current window's handle (Windows-only).
- _WINDOWHASFOCUS returns true (-1) when the program is the foremost window (Windows-only). Always returns -1 in other OSes.
- _TITLE$ (function) returns the last title set using the _TITLE statement.
- Fetch an image from the clipboard with handle& = _CLIPBOARDIMAGE
- If there isn't an image in the clipboard, handle& will be -1.
- Copy a valid image to the clipboard (All screen modes, except 0) with _CLIPBOARDIMAGE = handle&
A line starting with a TAB character and an ELSE clause would be incorrectly regarded as having a syntax error when compiling via command line interface. This fixes that issue.
Change to mem.TYPE from LONG variable type to OFFSET. This prevents
4-bytes padding from throwing off values for mem.ELEMENTSIZE and
mem.IMAGE on 64-bit systems.
Patch should work on Mac, Linux, and Windows; both 32-bit and 64-bit
versions, giving the correct results for mem.ELEMENTSIZE and mem.IMAGE
from now on.
This reverts commit cca11e8f90.
This and previous reverts remove ICON-related changes, which were
simply too questionable (in stability terms) this close to a planned
release.
Also:
- Revamp _ICON so it'll use the embed icon if it's called without parameters. The default QB64 icon is still used otherwise.
- Fix "Creating .EXE..." being printed in the wrong coordinates (IDE)
- Fix the new error message (when Debug is <> 0) so it'll show properly when compiling with -x.
When the cursor is on a an open "(" or closing ")" bracket, the matching pair, to the left or right, will be highlighted (as seen in modern IDEs, like https://blogs.msdn.microsoft.com/zainnab/2010/09/07/automatic-delimiter-highlighting/)
Also:
- Overall visual adjustments.
- Improved IDE Colors dialog (Options menu), which includes an option to disable bracket highlighting.
- Adds Ctrl+S as a shortcut for File->Save.
- Displays an * on the filename in the title bar below the menu bar when the source has been edited.
- Fixes an old bug that would color strings incorrectly when the source view was scrolled to the right.
- Enables block indent functionality in the Edit menu even when autoindent is on.
- Allows the View SUBs dialog (F2) to be invoked while focus is on the quick search bar.
Previously, if the IDE had focus while a compiled program was being run (F5), any input on the window would later be processed, messing up the source code sometimes. That's been fixed.
Block indentation is now allowed even with auto-indentation is on. A bit useless at first, as the IDE will override any custom indentation attempt while ideautoindent is on, but at least now TAB doesn't inadvertedly delete selection contents anymore.
Expand cursor behavior to work even when auto layout/indentation are active, so that edition feels more natural.
Also:
- Improved cursor behavior when using backspace to collapse a line into the previous one (check out code comments for easier understanding).
Uses _PALETTECOLOR to change the background of the IDE to a darker shade while external compilation is taking place, to give a sense of temporary unavailability.
Also:
- Improved messagebox (allows multiline messages with CHR$(10) terminated lines.
- Fixed a minor bug that could be triggered by right-clicking a selection that contained only sigils.
- Add -e for compiling with OPTION _EXPLICIT activated from the command line - even if the source file doesn't have the directive.
- Add -o for specifying a different output executable file name.
- More flexible syntax, as switches can come after the file name, making the following acceptable: qb64 filename.bas -x -e -o myprog.exe
- No two OPTION _EXPLICIT can be entered
- You can OPTION _EXPLICIT: DO OTHER STUFF 'and comment on the same line
- Extreme cases of bad formatting like OPTION _EXPLICIT are fine.
When you use OPTION _EXPLICIT, all variables and arrays must be defined with DIM (or equivalent statement) before they can be used. QB64's case check already aids in avoiding mistakes on that front, but now you will run into a compiler error if a variable or array is used before being defined.
Because OPTION _EXPLICIT sets a compiler behavior, it must come before any other statements in your code.
As this is a non-QB4.5 feature, the keyword uses an underscore, in order to avoid conflicts with existing code.
Upon hovering the Back button right below the menu bar, the next QuickNav location will be shown as "back to line ##".
Also:
- Fix label color in the "Google Android" dialog.
- Fix a bug that could occur when invoking the contextual menu with an empty selection.
- Relocate Undo/Redo to the top of the Edit menu.
Upon entering any _RGB statement, the IDE will offer to launch the mixer dialog, which can be done by hitting Shift+ENTER. Right-clicking existing statements allows triggering the mixer dialog from the contextual menu.
External libraries can now sit in the same folder as your source file without the need to specify a full path. You can use .libraryname or ./libraryname with DECLARE LIBRARY statement blocks.
(Windows only for now)
When active, this new setting will instruct the compiler to save the .EXE in the same folder as the source file. If the current program is not yet saved, the .EXE is placed in the same folder as QB64.EXE, as usual.
Also:
- When "Make EXE only (F11)" is used, the status area will show "Location: " and a link to the folder where the .EXE was saved. Clicking it launches Windows Explorer.
When auto indent is turned off in Options->Code Layout, hitting ENTER to create a new line will cause the cursor to be aligned with the previous line start, making it easier to manually indent code.
Also:
- Hitting backspace when there's no text before the cursor will also cause it to jump back following the tab spacing set in the Code Layout dialog.
The setting to place the cursor after the pasted contents is now observed in textboxes (dialog boxes) and also in the quick search field.
Also:
- Textboxes are now always selected upon receiving focus in dialog boxes, in order to mimic modern OS's behavior.
The only indication that the program was being compiled was the "..." on the status area. Now, if you hit F5 (or F11) and your program is still being compiled to C++, you will see a progress indicator on the bottom status line.
Also:
- Display "Start typing to search for text in this help page" upon invoking the help system (the search functionality is already built-in).
Default behavior (which mimics Qbasic) is to keep the cursor in place even after pasting from the clipboard. This new option alters such behavior to act as modern systems, placing the cursor after the pasted content.
Also:
- Add visual indication that mouse buttons have been swapped (Options menu);
- Allows opening menus with a right-click (in case you forget you swapped mouse buttons);
- Minor tweaks to Code layout dialog box.
Previously, upon clicking the Quick Navigation button, the IDE could accidentally select all lines between the current and the destination line. Such behaviour has been fixed.
After using any Quick Navigation method (Search > Goto line, Right-click > Goto SUB/FUNCTION or Goto label, Bookmark navigation, SUB/FUNCTION selection box), a left facing arrow will show right under the File menu, allowing to browse to where you were before navigation.
ALSO:
- "Goto line" dialog box now remembers the last line number that was input.
The "Unhandled error" message will now display "Line: #### (included line: ####)" with the line number in the included file that generated the error. 0 will be reported if the error wasn't in an included line.
Also:
- Add function _INCLERRORLINE, which returns a value greater than zero when _ERRORLINE points to an $INCLUDEd file.
$ELSEIF FLAG THEN was being turned into $ELSEIF IF FLAG THEN THEN when a precompiler condition had already been met in an $IF block before the current $ELSEIF.
Implements changes to allow programs to run on ARMBI-v7 Android devices which also provides a massive performance boost to but runtime and startup time.
Implements changes to allow programs to run on x86-based Android devices.
Fix to ensure variables allocated in the "stack" are aligned on appropriate boundaries which would have otherwise crashed on Android.
Fix to _DEVICES to ensure variables are aligned on appropriate boundaries which would have otherwise crashed on Android (includes some refactoring).
Added permissions to allow reading from/writing to external storage. Use the _DIR$(...) function to help locate appropriate paths.
Since _SCREENHIDE doesn't currently work on Linux, alterations were made
to the auto-position routine to keep the IDE from storing screen
positions when minimized and closed that would make it reopen off-screen
and impossible to move/position.
IDE error messages would give invalid reports if the program encountered
an error on the automatically included QB64 virtual keyboard files.
This should correct that and have the IDE reporting the proper messages
once again.
When two 'Go to...' are shown (when label and procedure share the same name), the item that goes to procedure will have G highlighted and the item that goes to a label will have L highlighted.
The same improvements made to qb64_start_osx.command are now present in the .command file that is generated in OS X after a program is compiled into an executable. This way, Terminal is closed as soon as the program is launched.
If a user right-clicks a SUB/FUNCTION name or a label name anywhere in the code, the contextual menu now offers to jump to the line where such procedure/label is defined, providing a quick way to navigate through code. Even if there are multiple identical labels in different procedures, scope is taken into consideration, leading you to the definition that's located inside the current procedure.
- Available only when auto indent is turned off (Options/Code layout).
- Also available from Edit menu and contextual right-click menu.
Known issue: When auto spacing is on, if you try to indent the first line the file, it is immediately repositioned at the start of the line. Only happens to the first line.
- Menu items starting with a tilde ("~") are displayed with COLOR 8 and without hotkeys highlighted. Clicking on them does nothing, but closes the menu.
- Edit menu is now context-aware. Cut, copy and clear are only enabled if there is a selection. Paste is only enabled if _CLIPBOARD$ is not empty.
- Fix updating the display after selecting an item in search history.
- Add the ability to click the search field and unselect/position the cursor (overrides previous double-click to erase behavior).
- Place cursor inside the help window when it's first invoked (allows for quick peek and ESC to close the help window).
- Allow ESC to close the dialog (named "Which?"), used to clarify the help context.
- Allow CTRL+UP or DOWN to scroll the window by one line at a time, without moving the cursor.
- Fix quick link feature (F2) to recognize FUNCTION names ending with single or multiple sigils.
- Fix external procedures being considered local and placed in front of program name.
- Allow the spacebar to work like ENTER when a button has focus.
- Improve textbox behavior: allow selection, delete selection, replace selection when typing.
- Preselect textbox contents if it's preset when dialog is invoked (Save as, Find and Change dialogs)
- Fix: an asterisk sign will be only added to the valid searchable characters in a listbox if the user is explicitly searching for it.
- Move the quick search field to the status area.
- Add Ctrl+F to set focus to quick search field.
- Add Ctrl+F3 shortcut to invoke the Find dialog.
- Add Alt+UP or DOWN to invoke the recent searches dropdown list, if the focus is on the quick search field.
- Show a contextual menu upon right-clicking on the text area. Includes the Edit menu options as well as contextual search and help.
- Add hovering to menus items.
- Adjust case of menu items (CTRL and Ctrl were being used interchangeably without a pattern).
A quick current SUB/FUNCTION check was added to complement the program title with a colon and said SUB/FUNCTION name, exactly like it was done in QB4.5, for quick reference. Doesn't add much of a burden to the overall performance since FUNCTION ide2 already updates the main window title every main LOOP anyway.