gruntydatsun Posted February 20, 2008 Posted February 20, 2008 Hello, Does anyone know the function that creates a string with X number of characters... like: MakeString(".",10) for a string with 10 .'s
MrBo Posted February 20, 2008 Posted February 20, 2008 Not quite what you asked for - but a function I use for something similar is:$string = "EXTRA:"$string = $string & _Padding($string,".")msgbox(0,"Test",$string)Func _Padding($strPad, $padchar) Local $x, $msg For $x = 1 to 14 $msg=$msg & $padchar if StringLen($strPad & $msg) >= 14 Then ExitLoop Next Return $msgEndFunc$string will = input string + the padding character up to 14 characters in totalCheers,Jim BoHello,Does anyone know the function that creates a string with X number of characters...like: MakeString(".",10)for a string with 10 .'s
Moderators SmOke_N Posted February 20, 2008 Moderators Posted February 20, 2008 (edited) Hello, Does anyone know the function that creates a string with X number of characters... like: MakeString(".",10) for a string with 10 .'sI fail to see the complexity of what you are asking really. If you've ever worked with functions or loops, it would have taken you less time to write the function yourself then it did to start the thread.MsgBox(64, "Info", _MakeString(".", 10)) Func _MakeString($sChar, $nCount) Local $sHold For $iCC = 1 To $nCount $sHold &= $sChar Next Return $sHold EndFunc Edit: I thought I remembered a function to do this already in existence.... _StringRepeat Edited February 20, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
gruntydatsun Posted February 20, 2008 Author Posted February 20, 2008 Nice. Thanks for that Smoken. Your edit was the answer to the question minus the judgement....
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now