How to create repeating character strings in Revolution
Posted: Tue Feb 10, 2009 2:36 am
Could someone explain why the following statements give different results:
put format("%40c",space) into t40Spaces
put format("%40c"," ") into t40Spaces
put format("%40c",32) into t40Spaces
put format("%40c",charToNum(" ")) into t40Spaces
The last two statements do what I expect; puts a string with 40 spaces into the variable t40Spaces. The first two statements create a 40 space string ending with the character "8".
Also, is there another simple method using revolution to create strings of repeating characters other than using the format statement.
I believe there are other languages such as Python that overload operators such as "*" to do this making 40*' ' a string with 40 space characters. I do not see an equivalent in Revolution.
Thanks,
put format("%40c",space) into t40Spaces
put format("%40c"," ") into t40Spaces
put format("%40c",32) into t40Spaces
put format("%40c",charToNum(" ")) into t40Spaces
The last two statements do what I expect; puts a string with 40 spaces into the variable t40Spaces. The first two statements create a 40 space string ending with the character "8".
Also, is there another simple method using revolution to create strings of repeating characters other than using the format statement.
I believe there are other languages such as Python that overload operators such as "*" to do this making 40*' ' a string with 40 space characters. I do not see an equivalent in Revolution.
Thanks,