Author Topic: Why can't you use C#/C++ commands in QB64  (Read 3760 times)

0 Members and 1 Guest are viewing this topic.

FellippeHeitor

  • Guest
Re: Why can't you use C#/C++ commands in QB64
« Reply #15 on: September 11, 2018, 12:42:34 am »

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
Re: Why can't you use C#/C++ commands in QB64
« Reply #16 on: September 11, 2018, 11:48:30 am »
I = I + 2 is a total of 5 letters typing (not counting spaces, which will auto format themselves).   

_INC I, 2 is 7 letters typing...

I don't see any improvement here.  In many cases it's not saving any typing.  It's not as BASIC to read/understand.  Even in cases with long variable names, it saves very little time/work (just copy/paste the variable name to the other side of the equal sign if needed).

What I'd love to see is an ANY type for SUBS/FUNCTIONS, then you could do this easily yourself:

INC I, 2

SUB INC (var AS ANY, amount)
    var = var + amount
END SUB

With var defined AS ANY, it'll pass values back regardless to what data type you send to it, allowing for easy creation of such routines for those who want them.

I've proposed something similar a while back in the development section on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there], which is gone now. The improvement comes when your variable is not just one letter but a longer name or even a user type variable:
eg: cnt% = cnt% + 1 or MyType.counter = MyType.counter + 1
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack