Diamond: Difference between revisions
From NARS2000
Jump to navigationJump to search
No edit summary |
(→Usage) |
||
Line 4: | Line 4: | ||
[[File:APLKB-Diamond.png]] | [[File:APLKB-Diamond.png]] | ||
==Usage== | ==Usage== | ||
While the diamond operator (<big><big>{diamond}</big></big>) can be used in an immediate statement to the Session Manager, it is most commonly used in a [[functions|function]] to start a new statement on the same line. It is used similarly to the semi colon ('''<big>;</big>''') in C, Pascal, PHP and many other languages, or the colon ('''<big>:</big>''') and backslash ('''<big>\</big>''') in some versions of Basic. It allows another statement to be entered on the same line. | |||
'''Note:''' The <big><big>{diamond}</big></big> operator cannot be used after a [[lamp]] (<big><big>{lamp}</big></big>) comment operator appears on the same line, as all characters after <big><big>{lamp}</big></big> are ignored. | |||
==Example== | ==Example== | ||
In this example, the variable K is tested to see if it is greater than or equal to 1. If the test fails, k is set to 1.<br/> | In this example, the variable K is tested to see if it is greater than or equal to 1. If the test fails, k is set to 1.<br/> |
Revision as of 01:53, 14 March 2013
⋄ — Statement separator — Keystroke ALT+` (Accent grave) — Character 8900 or x22C4
Usage
While the diamond operator (⋄) can be used in an immediate statement to the Session Manager, it is most commonly used in a function to start a new statement on the same line. It is used similarly to the semi colon (;) in C, Pascal, PHP and many other languages, or the colon (:) and backslash (\) in some versions of Basic. It allows another statement to be entered on the same line.
Note: The ⋄ operator cannot be used after a lamp (⍝) comment operator appears on the same line, as all characters after ⍝ are ignored.
Example
In this example, the variable K is tested to see if it is greater than or equal to 1. If the test fails, k is set to 1.
→(k≥1)/Xr ⋄ K←1
Xr:
It is the same as
→(k≥1)/Xr
K←1
Xr:
See Also | ||
System Commands | System Variables and Functions | Operators |
Keyboard | ||||||||||||||
Alt+Shift | ⍪ | ≡ | ≢ | ⍒ | ⍋ | ⌽ | ⍉ | ⊖ | ⍟ | ⍱ | ⍲ | ⍠ | ⌹ | |
Alt | ⋄ | ¨ | ¯ | < | ≤ | ∅ | ≥ | > | ≠ | ∨ | ∧ | × | ÷ | |
Shift | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | |
Key | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | |
Alt+Shift | ⍷ | √ | ⍨ | ⍸ | ⍥ | ⍣ | ⍞ | ⍬ | ⊣ | |||||
Alt | ? | ⍵ | ∊ | ⍴ | § | ↑ | ↓ | ⍳ | ○ | π | ← | → | ⊢ | |
Shift | Q | W | E | R | T | Y | U | I | O | P | { | } | | | |
Key | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | |
Alt+Shift | ∫ | ∂ | ⌻ | ⍢ | ⍙ | ⍤ | ⍫ | ⌷ | ||||||
Alt | ⍺ | ⌈ | ⌊ | ∞ | ∇ | ∆ | ∘ | ‼ | ⎕ | ⍎ | ⍕ | |||
Shift | A | S | D | F | G | H | J | K | L | : | " | |||
Key | a | s | d | f | g | h | j | k | l | ; | ' | |||
Alt+Shift | ⊆ | ⊇ | χ | ⍡ | ⍭ | ⊙ | ||||||||
Alt | ⊂ | ⊃ | ∩ | ∪ | ⊥ | ⊤ | ⍦ | ⍝ | ⍀ | ⌿ | ||||
Shift | Z | X | C | V | B | N | M | < | > | ? | ||||
Key | z | x | c | v | b | n | m | , | . | / |
NARS 2000 Lang Tool Bar |
← | → | + | - | × | ÷ | * | ⍟ | ⌹ | ○ | ! | ? | √ | | | ⌈ | ⌊ | ⊥ | ⊤ | ⊣ | ⊢ | |||
≡ | ≢ | < | ≤ | = | ≥ | > | ≠ | ∨ | ∧ | ⍱ | ⍲ | ↑ | ↓ | ⊂ | ⊃ | ⌷ | ⍋ | ⍒ | |||||
⍳ | ∊ | ⍸ | ⍷ | ∪ | ∩ | ⊆ | ⊇ | ~ | § | π | .. | , | ⍪ | ⍴ | ⌽ | ⊖ | ⍉ | ||||||
/ | \ | ⌿ | ⍀ | ⊙ | ¨ | ⍨ | ⍤ | ⍣ | ⍡ | ⍥ | ⍦ | . | ∘ | ⍠ | ‼ | ⌻ | ∂ | ∫ | ⍞ | ⎕ | ⍎ | ⍕ | |
⋄ | ⍝ | ∇ | ∆ | ⍙ | _ | ⍺ | ⍵ | ¯ | ⍬ | ∞ | ∅ | ||||||||||||
Second Row | i j k | i j k l | g | p | r | v | x |
[[Category:Mouse Group {{{1}}}|{{{2}}}]]