Arrays (Please Help)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Werner
    New Member
    • Jul 2006
    • 4

    #1

    Arrays (Please Help)

    Hi!

    Stupid question i know.How do i load 2 public arrays with inputed text and then send that values to a richtextbox for printing? I know the printing part. Just strugling with the array bit.

    PLEASE HELP ME!
    Its driving me MAD!
  • coldflame
    New Member
    • Jul 2006
    • 19

    #2
    Originally posted by Werner
    Hi!

    Stupid question i know.How do i load 2 public arrays with inputed text and then send that values to a richtextbox for printing? I know the printing part. Just strugling with the array bit.

    PLEASE HELP ME!
    Its driving me MAD!
    i hope that will give some idea

    dim str(3) as string ' An array of string with 3 indexes

    Using an array is simple

    str(0) = txtbox1.text
    str(1) =txtbox2.text
    str(2) =txtbox3.text

    Comment

    • ArkDawg
      New Member
      • Jul 2006
      • 1

      #3
      Originally posted by Werner
      Hi!

      Stupid question i know.How do i load 2 public arrays with inputed text and then send that values to a richtextbox for printing? I know the printing part. Just strugling with the array bit.

      PLEASE HELP ME!
      Its driving me MAD!
      try the following

      Dim Str1, Str2, Str3, Str4 As String

      Str1 = "The is a test"
      Str2 = "of string array concatenate example"
      Str3 = "First Load the Array with strings"
      Str4 = "Then load a string to pass to the rich text box"

      Dim Array1()
      Dim Array2()

      Array1(0) = Str3
      Array1(1) = Str4
      Array2(0) = Str1
      Array2(1) = Str2

      Dim passstr As String

      For i As Integer = 0 To 1
      Select Case i
      Case 0
      passstr = Array1(0) & vbCrLf & Array1(1) & vbCrLf

      Case 1
      passstr = Array2(0) & vbCrLf & Array2(1) & vbCrLf

      End Select
      Next

      Finally assign the passstr to the rich text box.

      Have Fun ........
      ArkDawg

      Comment

      Working...