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 GLFX005, Today, 03:23 AM
|
0 responses
1 view
0 likes
|
Last Post
by GLFX005
Today, 03:23 AM
|
||
Started by XXtrader, Yesterday, 11:30 PM
|
2 responses
11 views
0 likes
|
Last Post
by XXtrader
Today, 03:07 AM
|
||
Started by Waxavi, Today, 02:10 AM
|
0 responses
6 views
0 likes
|
Last Post
by Waxavi
Today, 02:10 AM
|
||
Started by TradeForge, Today, 02:09 AM
|
0 responses
14 views
0 likes
|
Last Post
by TradeForge
Today, 02:09 AM
|
||
Started by Waxavi, Today, 02:00 AM
|
0 responses
3 views
0 likes
|
Last Post
by Waxavi
Today, 02:00 AM
|
Comment