User Tools

Site Tools


programming:smilebasic:api_reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
programming:smilebasic:api_reference [2024-08-09 02:37] – [Input/Output] add PRINT zlgprogramming:smilebasic:api_reference [2024-08-09 03:11] (current) – [Value Ranges] remove redundancy zlg
Line 44: Line 44:
  
 These operators are your standard addition, subtraction, multiplication, and division. Modulo is usually also included in this set. These operators are your standard addition, subtraction, multiplication, and division. Modulo is usually also included in this set.
 +
 +  * ''+''
 +  * ''-''
 +  * ''*''
 +  * ''/''
 +  * ''%''
 +
 +==== Comparison ====
 +
 +Comparison operators allow you to make decisions when you need to branch the behavior of a program with ''IF..THEN'' or fancy ''[[#goto|GOTO]]'' spaghetti.
 +
 +  * ''=='' - Equality
 +  * ''!='' - Inequality
 +  * ''>'' - Greater Than
 +  * ''<'' - Less Than
 +  * ''>='' - Equal to or Greater Than
 +  * ''<='' - Equal to or Less Than
 +
 +These same operators can be used stand-alone in expressions to generate boolean values, which are typically ''0'' or ''1''.
 +
 +==== Logical ====
 +
 +Logical operators are often combined with expressions that contain comparison operators in order to make meaningful decisions in the program. This means most "business" problems in programming can be broken down into //some// variation of:
 +
 +<code>
 +Solution = Logical operations of expressions, containing
 +           comparisons of variables, containing
 +           anything from numbers to text to lists.
 +</code>
 +
 +If you can abstract a problem into this framework, you are mastering logical operators.
 +
 +  * ''&&'' - Logical AND
 +  * ''||'' - Logical OR
 +
 +The more legible ''AND'' and ''OR'' may also be used, but precedence may differ. More testing is needed.
  
 ===== Logic and Control Flow ===== ===== Logic and Control Flow =====
Line 106: Line 142:
 |  Z   | -256-1024 | |  Z   | -256-1024 |
  
-The Z axis is remembered from the last LOCATE call if not specified, and defaults to 0.+The Z axis defaults to 0.
  
 Any missing axes from a LOCATE call will be filled in with the last value used for that axis. All axes default to 0 if LOCATE is called after a CLEAR. Any missing axes from a LOCATE call will be filled in with the last value used for that axis. All axes default to 0 if LOCATE is called after a CLEAR.
programming/smilebasic/api_reference.1723171026.txt.gz · Last modified: 2024-08-09 02:37 by zlg