Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: Minwah on August 29, 2006, 08:06:48 am
-
Just a quicky....for some reason I can't for the life of me remember the string function to display x amount of a certain character...it works like this, this would return 'c' 10 times:
Keyword("c", 10)
Someone please put me out of my misery, I know it is simple :banghead:
-
Just a quicky....for some reason I can't for the life of me remember the string function to display x amount of a certain character...it works like this, this would return 'c' 10 times:
Keyword("c", 10)
Someone please put me out of my misery, I know it is simple :banghead:
I think you want:
String() - Creates a repeated character string
Language: VBScript
Description
The String() function creates a string of optional length filled with the specified character.
String(length, character)
Example
MyString = String(3, "T") 'returns "TTT"
MyString = String(5, "?") 'returns "?????"
-
That's exactly it, thanks very much...was driving me mad! :applaud:
-
I've gotta ask... what in the world are you going to use it for?
-
I've gotta ask... what in the world are you going to use it for?
Well as it happens I am not now...but I was going to use it in this context:
.TextWidth(String(x, "W")
...just to return the max width of a bunch of characters (guessing W is one of the widest).
But since all characters are a different width (depending on font), I decided it would be better to use a proper string. But still, it was just bugging me what the darn keyword was! :)
-
Well that's what I was wondering. it isn't particularly useful unless you are wanting to make a dividing line or something. Thought you might be doing something cool. ;)