You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _build/reference/680-language-for.markdown
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,16 +13,21 @@ Defines a FOR/NEXT loop.
13
13
- element - A variable to be used as the copy of the current element.
14
14
- array - An array or map variable
15
15
16
+
FOR/NEXT loops may be nested to any level of complexity, but there must be a NEXT for each FOR.
17
+
16
18
### FOR counter = start TO end [STEP incr] ... NEXT
17
19
18
20
SmallBASIC begins processing of the FOR/NEXT block by setting counter equal to start. Then, if 'incr' is positive and counter is not greater than end, the commands between the FOR and the NEXT are executed. When the NEXT is encountered, counter is increased by 'incr', and the process is repeated. Execution passes to the command following the NEXT if counter is greater than end.
19
21
20
-
If increment is negative, execution of the FOR/NEXT loop is terminated whenever counter becomes less than end. FOR/NEXT loops may be nested to any level of complexity, but there must be a NEXT for each FOR.
22
+
If increment is negative, execution of the FOR/NEXT loop is terminated whenever counter becomes less than end.
21
23
22
24
### FOR element IN array ... NEXT
23
25
24
26
The commands-block will be repeated for LEN(array) times. Each time the 'element' will holds the value of the current element of the array.
25
-
FOR/NEXT loops may be nested to any level of complexity, but there must be a NEXT for each FOR.
27
+
28
+
### FOR character IN string ... NEXT
29
+
30
+
The commands-block will be repeated for LEN(string) times. Each time the 'character' will holds the value of the current character of the string.
Copy file name to clipboardExpand all lines: _build/reference/801-string-translate.markdown
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# TRANSLATE
2
2
3
-
> s = TRANSLATE (source, what [, with])
3
+
> s = TRANSLATE (source, what [, with][, caseInsensitiv])
4
4
5
-
Translates all occurrences of the string `what` found in string `source` with the string `with` and returns the new string. If `with` is not given, all occurrences of `what` will be removed.
5
+
Translates all occurrences of the string `what` found in string `source` with the string `with` and returns the new string. If `with` is not given, all occurrences of `what` will be removed.`caseInsensitiv` can be `true` for case insensitiv or `false` for case sensitiy. If `caseInsensitiv` is not given, `TRANSLATE` is case sensitiv.
0 commit comments