AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fill string

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
[二oO也



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Fri Mar 11, 2005 4:56 pm    Post subject: Fill string Reply with quote

In BASIC there is a function like:
Code:

STRING$(20, b)

That, in this case, would return a string that contained 20 b's.

My question is: Is there something similar to this in AHK?

I know that I could use something like:
Code:

string =
loop, 20
string = %string%b

_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
Titan



Joined: 11 Aug 2004
Posts: 5049
Location: imaginationland

PostPosted: Fri Mar 11, 2005 5:06 pm    Post subject: Reply with quote

This works:
Code:
Loop, 20
   {
   String = %String%b
   }

_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
[二oO也



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Fri Mar 11, 2005 5:10 pm    Post subject: RE: Fill string Reply with quote

So, I'll take that as a no.... Crying or Very sad
Thanks anyway Smile

Maybe I should add it to "Wish List" forum.
_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
[二oO也



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Fri Mar 11, 2005 5:27 pm    Post subject: Re: Fill string Reply with quote

BTW, Titan: I don't think you need brackets if it's only one row that you "loop". Shocked
_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Fri Mar 11, 2005 5:43 pm    Post subject: Reply with quote

If you find it more readable, you can also use an expression:

Code:
Loop,20
String:=(String "b")
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group