Author Topic: v1.5 128 bit (and beyond) math *** COMPILER ERROR ***  (Read 30463 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: QB64 v1.5 Feature Request - new string functions
« Reply #45 on: July 27, 2020, 11:42:59 am »
I realize that "for next" can only contain one variable (correct me if I'm wrong)

my suggestion is enable "for next" to contain more variables

example:

Code: QB64: [Select]
  1. 'Actual:
  2. FOR X = 1 TO 5
  3. IF z < 3 THEN z = z + 1
  4.  
  5. Y = x + z
  6.  
  7. 'My suggestion
  8.  
  9. FOR X = 1 TO 5, z = 1 TO 3                        'CAN BE:  |IF z < 3 THEN z = z + 1|  OR  |z = z + 1: IF z > 3 then z = 1|
  10.  
  11. Y = x + z
  12.  
  13.  



Quote
I think I’m confused by the above.

Agreed, I took it to mean an (x, z) array with x columns and z layers. I was ignoring "actual" and just reading the code suggestion as I would finding it in an app.
« Last Edit: July 28, 2020, 12:05:28 am by bplus »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
A loop FOR NEXT with more variables...
how many?
the first is the counter of loop FOR and the other variables are added variables that cannot be longer/bigger than the first one.

For my little experience I cannot imagine when a feature like this can be used and what advantages can bring with it!
But this is only my point of view.
I'm look at its use.
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: QB64 v1.5 Feature Request - new string functions
« Reply #47 on: July 28, 2020, 12:09:10 am »
It is curious how ", multi-variable FOR-NEXT" was slipped into the topic title.

I took it out of my posts but odd how it got in there so that the whole thread is carrying that Title.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
For "BLOCK Statements" eg

FOR … NEXT
DO … LOOP
WHILE ...WEND
SELECT CASE … END SELECT
IF … ENDIF
etc

it would save some time to let the IDE auto fill the termination of the block code.

For example, when starting off a new line of code such as    FOR I....     that the IDE auto inserts a blank line followed by another line  NEXT I...

At present the IDE "flags an error" (FOR without NEXT) - which is correct but it is practically impossible to type in the required NEXT … line before the warning message pops up - so why not let the IDE just insert the NEXT … line instead of giving an error message?

Similarly for all the other "Block Statements" as per above (and maybe other things as well).

I know this may sound to be "poor programming" - however it would make sense to automate as much as possible any repetitive (even trivial) tasks to allow focus on the "real" programming task at hand.

« Last Edit: August 19, 2020, 01:04:23 am by Richard »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
For "BLOCK Statements" eg

FOR … NEXT
DO … LOOP
WHILE ...WEND
SELECT CASE … END SELECT
IF … ENDIF
etc

it would save some time to let the IDE auto fill the termination of the block code.

For example, when starting off a new line of code such as    FOR I....     that the IDE auto inserts a blank line followed by another line  NEXT I...

At present the IDE "flags an error" (FOR without NEXT) - which is correct but it is practically impossible to type in the required NEXT … line before the warning message pops up - so why not let the IDE just insert the NEXT … line instead of giving an error message?

Similarly for all the other "Block Statements" as per above (and maybe other things as well).

I know this may sound to be "poor programming" - however it would make sense to automate as much as possible any repetitive (even trivial) tasks to allow focus on the "real" programming task at hand.

The problem here comes with human-computer interaction.

DO
    Stuff
    FOR
        Stuff
    NEXT
     Stuff
LOOP

Let’s say the above is my code, as I wrote it originally.

Now, let’s say I want to move that NEXT to go before my LOOP statement, after the 3rd Stuff.

I cut it...   The IDE now detects a FOR without NEXT error, so it places a NEXT statement directly after the FOR...

I paste the NEXT at the new spot where I think it should belong...  ERROR — NEXT WITHOUT FOR...

And now I have to sort out where the heck that automatically inserted NEXT appeared, just so I can delete it!
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
Thanks Steve for reply.

The suggestion was for    "brand new code lines generated in real(live) time"    not for code already in existence - so feature not applicable to editing (copy/cut/paste , replacing, included files, etc.).

Similar to in the      IDE > Edit > New SUB... (or New FUNCTION...)
« Last Edit: August 19, 2020, 01:54:44 am by Richard »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Thanks Steve for reply.

The suggestion was for    "brand new code lines generated in real(live) time"    not for code already in existence - so feature not applicable to editing (copy/cut/paste , replacing, included files, etc.).

Except the IDE doesn’t know the difference between a new line and an edited line.  It just checks your whole program, from first character to last character, with every keystroke and change you make in the IDE.

Personally, I’d like to see a hotkey added for quick insertion based on the error message.

ERROR — FOR WITHOUT NEXT

Say we see the above error...  A hotkey combo of CTRL-I would paste a NEXT statement wherever our cursor current sits, as a quick insert method.

This hotkey only saves a few characters typing with NEXT, LOOP, WEND, END SUB, END FUNCTION, and such, but it could be a quick and easy means to define variables when OPTION _EXPLICIT is in use.

ERROR — MyVar NOT DEFINED

Just hit Ctrl-I and presto!  DIM MyVar AS SINGLE appears.  (Or whatever the default variable type is.  QB64 tracks those types internally, so it can define them automatically for you.)

(Of course, a different hotkey might be necessary, if ctrl-i is already in use, but I personally like the idea of having control over placement of code, rather than having the IDE automatically put it where it thinks it might belong.)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
How would this work instead …


Special hot "key cluster" example -


Press and hold [Ctrl] press "I" (and still holding Ctrl) press "F" (release Ctrl)  --->   auto generates  IF  … blank line …  END IF

Press and hold [Ctrl] press "F", press "O", press "R" (now release Ctrl)     ---> auto generates    FOR … blank line … NEXT

etc

So now almost like      IDE > Edit > New SUB...      functionality

Offline krovit

  • Forum Regular
  • Posts: 179
Hi,
What an interesting discussion!

Anyone who has "studied" a bit knows that "purist" programming approaches an idea with block diagrams and flowcharts ... in fact, I don't do that... :)

It would be a good system, if you have clear - but very clear - ideas about what you want. There are so many behavioral variables and cases that it is not always easy to operate in a "scientific" and preventive way.

In programming, the natural tendency to classify, order, predict, standardize helps me a lot. In this way, unexpected events are almost always absorbed into the code without too many traumas.

The thing I miss most in QB64 is an integrated and simple system that allows the observation of variables in every moment of the data flow. In some unfortunate cases - or when I resume a complex project after a long time - I waste hours trying to identify where a certain variable takes on a value rather than another. Assuming, then, that you find it!

Fellippe did something similar but it seems too heavy and invasive for everyday use.

The second thing missing is a truly powerful editor. I use DavsIDE, which I believe is the "maximum of the minimum" possible. Certainly there would be a need for much more. For example the identification of the code. In this regard a dedicated plug-in for Notepad ++ would be useful. Has anyone ever thought about it?

The third thing that would help a lot has to do with the editor and is a system that with the simple press of a function key compresses and expands the code contained in subs, functions and routines. this way the code would look more natural.

all this was present in a fantastic basic for the motorola 68000 of the Atari ST: it was the GFA Basic. A very powerful dialect (developed in Germany, I think) with which you could do anything and very similar to QB64. Plus many native functions for calling Atari's Apple-style visual systems.

In summary:
1) variable control
2) editor
3) code compaction and identification function


Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
Would be extremely useful to have option selectable   IDE loaded program auto refresh (programmable say every 60 seconds) or at least an IDE button to do manual refresh of loaded program.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
Option to modify TITLE bar to be a very short wide graphics window?


  [ You are not allowed to view this attachment ]  


I was thinking about changing the little icon on the left hand side to be a very wide icon instead and I would try to write a program to constantly change this in real time.

The intention is to have something like a "Windows Taskbar" or "Apple Dock" with VERY LIMITED graphics resolution - without resorting to putting same inside the program output window general graphics.

Hopefully someone can point me in the right direction in the QB64 source code to configure this specially - at this stage, depending on the format of the "very wide icon", I may not need assistance to create the "very wide icon".

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
Re: QB64 v1.5 MOVe & REName statements for files and directories
« Reply #56 on: September 25, 2020, 07:16:41 am »
Unless I missed it in all the posts...


Have proper means of MOVING and RENAMING files/directories without having to resort to eg

SHELL "COPY   D:\oldfilename$   D:\newfilename$"
KILL "D:\oldfilename$"

for renaming



Similarly


SHELL  "COPY    D:\filename$   D:\TRASH\filename$"
KILL "D:\filename$"

for moving


It is important to reduce wear and tear on the HHD and SSD - especially with SSD that have a very limited rewrite cycles (factored with when rewriting to SSD - depending on the model number - up to 4 MBytes minimum is "block erased" even for say a 4KB file due to the very nature of the non-volatile silicon design). Generally speaking SSD have close to "infinite" reads, it is just the erase/rewrite procedure that is drastically reduced in the number of times it can be performed.

Maybe a Windows API procedure?

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: QB64 v1.5 MOVe & REName statements for files and directories
« Reply #57 on: September 25, 2020, 08:34:33 am »
Unless I missed it in all the posts...


Have proper means of MOVING and RENAMING files/directories without having to resort to eg

SHELL "COPY   D:\oldfilename$   D:\newfilename$"
KILL "D:\oldfilename$"

for renaming



Similarly


SHELL  "COPY    D:\filename$   D:\TRASH\filename$"
KILL "D:\filename$"

for moving


It is important to reduce wear and tear on the HHD and SSD - especially with SSD that have a very limited rewrite cycles (factored with when rewriting to SSD - depending on the model number - up to 4 MBytes minimum is "block erased" even for say a 4KB file due to the very nature of the non-volatile silicon design). Generally speaking SSD have close to "infinite" reads, it is just the erase/rewrite procedure that is drastically reduced in the number of times it can be performed.

Maybe a Windows API procedure?

Try NAME: https://www.qb64.org/wiki/NAME

NAME "BIGBAD.TXT" AS "BADWOLF.TXT"
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
The third thing that would help a lot has to do with the editor and is a system that with the simple press of a function key compresses and expands the code contained in subs, functions and routines. this way the code would look more natural.

I'm not sure how a function key would work on something like that, but maybe a metacommand after a SUB/FUNCTION line that would hide all code between it and its END line. Once you've finished a SUB/FUNCTION and no longer need to work on it, it would be incredibly useful to have it working in the program, but hidden in the IDE and not hogging up scrolling time and visual space when navigating through large programs. While the View/SUBs dialog will get you there all the same and maybe quicker, I still think the reduction of screen clutter would be helpful. Very large projects, I think, would benefit greatly from this.

SUB DoABlock (var AS INTEGER, etc...)
stuff
stuff
stuff
stuff
END SUB

SUB BlockImWorkingOn (var AS INTEGER, etc...)
stuff
stuff
stuff
stuff
END SUB

FUNCTION GetAResult%
stuff
stuff
stuff
stuff
END FUNCTION

becomes....

SUB DoABlock (var AS INTEGER, etc...) $Hide2End

SUB BlockImWorkingOn (var AS INTEGER, etc...)
stuff
stuff
stuff
stuff
END SUB

FUNCTION GetAResult% $Hide2End

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • GitHub
Re: QB64 v1.5 MOVe & REName statements for files and directories
« Reply #59 on: September 25, 2020, 11:13:26 am »
(                               QB64 v1.5      MOVe   &   REName    statements for files and directories

@Richard For Move and Rename, check my API collection zip or the forum link here: https://www.qb64.org/forum/index.php?topic=3034.msg123040#msg123040
I used the WinAPI to write code to allow for Move, Copy, Rename, Recycle, and Empty Recycle Bin. Maybe this is what could be used for 1.5?
Shuwatch!