![]() |
STRING REPEATName:
where <sout> is the name of the resulting string; <sorg> is the name of the original string; and <count> is a number or parameter that specifies the number of times <sorg> will be repeated.
LET SOUT = STRING REPEAT S1 5
you need to do
LET SOUT = STRING REPEAT SORG 2 The repeat factor can be either a parameter or a numeric value. However, it cannot be a numeric expression. So
LET SOUT = STRING REPEAT SORG COUNT are both allowed but
is not allowed. You would need to enter this as
LET SOUT = STRING REPEAT SORG COUNT2 The name on the left hand side of the equal sign may be a previously existing string. However, if it is a previously existing parameter, variable, or matrix name, an error will be reported and the requested string will not be created.
The maximum length of the string to be repeated is 255 characters. If the the string is longer than this, an error is reported and the requested string will not be created.
let x = sequence 1 1 10 let x2 = x**2 let x3 = x**3 let string s = - let sdash = string repeat s 30 set write format 3F10.0 write1 temp.out " X X**2 X**3" write1 temp.out "^sdash" write1 temp.out x x2 x3The file temp.out contains X X**2 X**3 ------------------------------ 1. 1. 1. 2. 4. 8. 3. 9. 27. 4. 16. 64. 5. 25. 125. 6. 36. 216. 7. 49. 343. 8. 64. 512. 9. 81. 729. 10. 100. 1000.
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 08/11/2021 |