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 junkone, 04-28-2024, 02:19 PM
|
8 responses
92 views
1 like
|
Last Post Today, 01:58 AM | ||
Started by mkouitra, 10-23-2021, 04:40 PM
|
17 responses
1,964 views
0 likes
|
Last Post Today, 12:51 AM | ||
Started by Vietanhnguyen2hotmailcom, 05-03-2024, 10:29 AM
|
4 responses
29 views
0 likes
|
Last Post Yesterday, 09:06 PM | ||
Started by PhillT, 04-19-2024, 02:16 PM
|
4 responses
37 views
0 likes
|
Last Post
by PhillT
Yesterday, 04:24 PM
|
||
Started by ageeholdings, 05-01-2024, 05:22 AM
|
5 responses
40 views
0 likes
|
Last Post
by ageeholdings
Yesterday, 03:21 PM
|
Comment