Announcement
Collapse
No announcement yet.
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
-
In 25 years, I've never seen anything like that.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;
-
Well, here are some interesting ideas/hacks.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
-
Write a "for loop".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
-
Please stop frightening little boys and girls with Assembler pseudocode.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
-
Actually, my initial response was somewhat misleading. I was just reading some of my very ooooold code, and realized that I used to do this quite often then. You can actually do it using the string constructor itself!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.
will make s contain XXXXXCode: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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
332 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment