Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Latest commit

 

History

History
77 lines (64 loc) · 2.32 KB

INC.org

File metadata and controls

77 lines (64 loc) · 2.32 KB

Top | Up (Operators) | < Previous (PAGE NAME) | Next (DEC) >

INC

Adds a value to a variable. Works on numbers and strings.

Syntax

INC number_variable [, amount]
INC string_variable$, string$

INC variable, amount is a shorter way of writing variable = variable + amount (similar to variable +=​ amount in other languages). amount is 1 if omitted.

When used on strings, INC works the same as PUSH (but slightly faster). Either way is more efficient than + because they modify the string rather than making a copy.

Examples

X=13
INC X
PRINT X '14

S$="abc"
INC S$,"defg"
PRINT S$ 'abcdefg

Version Information

3.2.0

Using INC on a string literal which was passed to a function no longer crashes. 1

3.3.0

Fixed bugs caused by using INC or DEC on a system variable.

References

1 SmileBoom, “Fixes in Ver. 3.2.0 (June 17, 2015)” http://smilebasic.com/en/debug/archive/ 2 SmileBoom, “Bug Fixes in Ver. 3.3.0 (April 26, 2016)” http://smilebasic.com/en/debug/archive/


Top | Up (Operators) | < Previous (PAGE NAME) | Next (DEC) >