|
1 | | -/* Copyright (C) 2003-2015 LiveCode Ltd. |
| 1 | +/* Copyright (C) 2003-2016 LiveCode Ltd. |
2 | 2 |
|
3 | 3 | This file is part of LiveCode. |
4 | 4 |
|
@@ -532,8 +532,10 @@ The result: <Operand> formatted as a string. |
532 | 532 |
|
533 | 533 | Example: |
534 | 534 | variable tNum as Number |
| 535 | + variable tString as String |
535 | 536 | put 5 into tNum |
536 | | - format tNum as string -- the result contains "5" |
| 537 | + format tNum as string into tString |
| 538 | + -- tString contains "5" |
537 | 539 |
|
538 | 540 | Description: |
539 | 541 | Use <FormatNumberAsString> when you want to manipulate a numeric value as text. |
@@ -591,11 +593,11 @@ Example: |
591 | 593 | parse tString as Number -- the result is 5.6 |
592 | 594 |
|
593 | 595 | Example: |
594 | | - variable tResult as String |
| 596 | + variable tResult as optional String |
595 | 597 | variable tNum as optional Number |
596 | | - parse "aaaa" as Number |
| 598 | + parse "aaaa" as Number into tNum |
597 | 599 |
|
598 | | - if the result is nothing then |
| 600 | + if tNum is nothing then |
599 | 601 | put "unable to parse string" into tResult |
600 | 602 | end if |
601 | 603 |
|
@@ -658,7 +660,8 @@ Example: |
658 | 660 | variable tListOfString as List |
659 | 661 | variable tListOfNum as List |
660 | 662 | split "1,2,3,4" by "," into tListOfString |
661 | | - parse tListOfString as list of number -- the result contains [ 1, 2, 3, 4 ] |
| 663 | + parse tListOfString as list of number into tListOfNum |
| 664 | + -- tListOfNum contains [ 1, 2, 3, 4 ] |
662 | 665 |
|
663 | 666 | Description: |
664 | 667 | Use <ParseListOfStringAsListOfNumber> when you want to interpret pieces of text numerically. If the input list contains elements which cannot be parsed as numbers, the corresponding element will be nothing. |
|
0 commit comments