Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
text string repeat in a Print statement?
Collapse
X
-
text string repeat in a Print statement?
i'm searching for, but have not yet found [with Google and/or the Forum], a way to specify a character [or more generally a text string] to be repeated a specified number of times in a Print statement [eg] something like maybe Print(33("x")); to print a string of 33 x's. Help will be appreciated.Tags: None
-
Originally posted by joemiller View Posti'm searching for, but have not yet found [with Google and/or the Forum], a way to specify a character [or more generally a text string] to be repeated a specified number of times in a Print statement [eg] something like maybe Print(33("x")); to print a string of 33 x's. Help will be appreciated.
You'll need to create your own function and return a string.
pseudo code:
function repeat_string ( string_to_repeat varchar2, repeat number )
return varchar2
is
rString varchar2(1000);
begin
for i in 1..repeat
loop
rString := rString || string_to_repeat;
end loop;
return rString;
end;
-
Originally posted by joemiller View Posti'm searching for, but have not yet found [with Google and/or the Forum], a way to specify a character [or more generally a text string] to be repeated a specified number of times in a Print statement [eg] something like maybe Print(33("x")); to print a string of 33 x's. Help will be appreciated.
Comment
-
Originally posted by joemiller View Posti'm searching for, but have not yet found [with Google and/or the Forum], a way to specify a character [or more generally a text string] to be repeated a specified number of times in a Print statement [eg] something like maybe Print(33("x")); to print a string of 33 x's. Help will be appreciated.
Comment
-
Originally posted by sledge View PostIn 25 years, I've never seen anything like that.
You'll need to create your own function and return a string.
pseudo code:
function repeat_string ( string_to_repeat varchar2, repeat number )
return varchar2
is
rString varchar2(1000);
begin
for i in 1..repeat
loop
rString := rString || string_to_repeat;
end loop;
return rString;
end;
Comment
-
Originally posted by joemiller View Postthanks, that help a lot in that I will not waste any more time on it. I will just go ahead and type in a long string of whatever text I need whenever I need it.
Code:string s = [URL="http://www.google.com/search?q=new+msdn.microsoft.com"]new[/URL] String('X', 5);
which you can then Print().
That should be plain enough, but I can always post a quick-and-dirty 2 lines if you want.
Better yet, here is a somewhat comprehensive reference for you.
ref: http://msdn.microsoft.com/en-us/libr...#Ctor3_Example
I need to polish up my Google-Fu.Last edited by koganam; 06-22-2013, 05:04 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
1 view
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
6 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
||
Started by timmbbo, Today, 08:59 AM
|
2 responses
10 views
0 likes
|
Last Post
by bltdavid
Today, 04:10 PM
|
||
Started by alifarahani, Today, 09:40 AM
|
6 responses
41 views
0 likes
|
Last Post
by alifarahani
Today, 03:18 PM
|
Comment