473,387 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Repeat A String In A Textbox

I need a textbox to be set to a string of 15 Xs. Is there some expression
that does something like the following pseudocode:
MyTextbox = "X"(15)

If there is, can it be done with a multiple character string; ie, set the
textbox to a string of XYZ repeated 15 times? Something like:
MyTextbox = "XYZ"(15)

In 1, MyTextbox would contain "XXXXXXXXXXXXXXX"
In 2, My Textbox would contain "XYZXYZXYZXYZXYZ..... out 15 times.

I know it can be done easily in a loop.

Steve
Nov 13 '05 #1
3 5792
PC Datasheet wrote:
I need a textbox to be set to a string of 15 Xs. Is there some expression
that does something like the following pseudocode:
MyTextbox = "X"(15)

If there is, can it be done with a multiple character string; ie, set the
textbox to a string of XYZ repeated 15 times? Something like:
MyTextbox = "XYZ"(15)

In 1, MyTextbox would contain "XXXXXXXXXXXXXXX"
In 2, My Textbox would contain "XYZXYZXYZXYZXYZ..... out 15 times.

I know it can be done easily in a loop.

Steve


String("X",15)

--
James
Nov 13 '05 #2

"PC Datasheet" <no****@nospam.spam> wrote in message
news:6a****************@newsread2.news.atl.earthli nk.net...
I need a textbox to be set to a string of 15 Xs. Is there some expression
that does something like the following pseudocode:
MyTextbox = "X"(15)

If there is, can it be done with a multiple character string; ie, set the
textbox to a string of XYZ repeated 15 times? Something like:
MyTextbox = "XYZ"(15)

In 1, MyTextbox would contain "XXXXXXXXXXXXXXX"
In 2, My Textbox would contain "XYZXYZXYZXYZXYZ..... out 15 times.

I know it can be done easily in a loop.

Steve


The String function will give you the 15 "X"s, but it only works with a
single character. (At least in A2K) I think you'll need to use a loop if
you need multiple characters repeated.

Nov 13 '05 #3
Thank you for the quick responses!

James, the function is actually:
String(15, "X")

Steve

"PC Datasheet" <no****@nospam.spam> wrote in message
news:6a****************@newsread2.news.atl.earthli nk.net...
I need a textbox to be set to a string of 15 Xs. Is there some expression
that does something like the following pseudocode:
MyTextbox = "X"(15)

If there is, can it be done with a multiple character string; ie, set the
textbox to a string of XYZ repeated 15 times? Something like:
MyTextbox = "XYZ"(15)

In 1, MyTextbox would contain "XXXXXXXXXXXXXXX"
In 2, My Textbox would contain "XYZXYZXYZXYZXYZ..... out 15 times.

I know it can be done easily in a loop.

Steve

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Zachary | last post by:
Hi I am developing web page using asp.net with c# coding. I would like to know how can i get the value of repeat same id name text box item in my aspx web page Let say i have textbox name ...
12
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the...
4
by: Maverick | last post by:
I have a javascript function that using to set focus to a text box after clicking a button (butSearch) which is called in Page_Load ********************************************** dim jsscript as...
1
by: Tim::.. | last post by:
Hi... Can someone please tell me the simplest solution to create an update page for a menu I have on an asp.net website... Basiclly I have 10 menu and 10 price fields that change every day! I...
8
by: Csaba Gabor | last post by:
I wrote a .repeat(n) function for strings which seemed to work fine: String.prototype.repeat = function(n) { // repeats the string n times if (n<1) return ""; if (n<2) return this; for (var...
3
by: Eric | last post by:
My query works fine. I check it in debugger it gives me the correct value. But the textbox which i create in the form is not bound with the table. I dont know it needs to bound or not as i need...
5
by: John L. Whelan | last post by:
Hi Everyone: I know that I can repeat a single character using the StrDup function. Is there a function that will allow me to repeat a string? StrDup(5,"John") returns "JJJJJ." Is there a...
3
by: Jana | last post by:
Good morning, Access gurus! I'm having a brain fart and can't seem to wrap my head around the logic for this problem, so I'm hoping someone out there can help me out. Here's my situation: I...
3
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.