Repeat A String In A Textbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PC Datasheet

    #1

    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 "XXXXXXXXXXXXXX X"
    In 2, My Textbox would contain "XYZXYZXYZXYZXY Z..... out 15 times.

    I know it can be done easily in a loop.

    Steve


  • James Arnold

    #2
    Re: Repeat A String In A Textbox

    PC Datasheet wrote:[color=blue]
    > 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 "XXXXXXXXXXXXXX X"
    > In 2, My Textbox would contain "XYZXYZXYZXYZXY Z..... out 15 times.
    >
    > I know it can be done easily in a loop.
    >
    > Steve
    >
    >[/color]

    String("X",15)

    --
    James

    Comment

    • Randy Harris

      #3
      Re: Repeat A String In A Textbox


      "PC Datasheet" <nospam@nospam. spam> wrote in message
      news:6aSLe.6202 $Je.2030@newsre ad2.news.atl.ea rthlink.net...[color=blue]
      > 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 "XXXXXXXXXXXXXX X"
      > In 2, My Textbox would contain "XYZXYZXYZXYZXY Z..... out 15 times.
      >
      > I know it can be done easily in a loop.
      >
      > Steve
      >[/color]

      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.

      Comment

      • PC Datasheet

        #4
        James and Randy

        Thank you for the quick responses!

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

        Steve



        "PC Datasheet" <nospam@nospam. spam> wrote in message
        news:6aSLe.6202 $Je.2030@newsre ad2.news.atl.ea rthlink.net...[color=blue]
        >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 "XXXXXXXXXXXXXX X"
        > In 2, My Textbox would contain "XYZXYZXYZXYZXY Z..... out 15 times.
        >
        > I know it can be done easily in a loop.
        >
        > Steve
        >[/color]


        Comment

        Working...