In QB64, is there a shortcut way to add something to itself?
For example:
MyRunningTotal = MyRunningTotal +1
-or-
MyRunningTotal = MyRunningTotal + 22
A shortcut to negate having to retype MyRunningTotal again on the right side of the equation?
Fellippe, Thanks for confiming that there is no built-in way to do want I asked.
bplus, Thanks for your efforts in creating work-around methods.
Since there is no built-in way in QB64 to do what I want, I created a script for the "AutoHotKey" program to Add, Subtract, Multiply and Divide a value to itself.
Here's my script:
;===== QB64 "Add, Subtract, Multiply, Divide" value to original variable =====
;.... Type variable name, then press (Ctrl +) to fill in the rest of the equation.
#IfWinActive ahk_class FREEGLUT
^=:: ; (Ctrl +) writes "x = x + "
send ^+{Left}
send ^c
send {End}
send {Space}={Space}
send ^v
send {space}{+}{space}
return
^-:: ; (Ctrl -) writes "x = x - "
send ^+{Left}
send ^c
send {End}
send {Space}={Space}
send ^v
send {space}{-}{space}
return
^8:: ;(Ctrl *) writes "x = x * "
send ^+{Left}
send ^c
send {End}
send {Space}={Space}
send ^v
send {space}{*}{space}
return
^/:: ;(Ctrl /) writes "x = x / "
send ^+{Left}
send ^c
send {End}
send {Space}={Space}
send ^v
send {space}{/}{space}
return
#IfWinActive
The "#IfWinActive ahk_class FREEGLUT" line allows this script to only run in QB64.
Type "MyRunningTotal" and then press the (Ctrl +) keys to fill in the rest of the equation as:
"MyRunningTotal = MyRunningTotal + "
Hope this helps others,
Raptor88