Results 1 to 6 of 6

Thread: Variable Concatenation

  1. #1

    Thread Starter
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631

    Variable Concatenation

    I have this coding

    VB Code:
    1. strCurrent = ""
    2.  
    3. Dim intFN As Int16
    4. For intFN = 0 To intTimes - 1
    5.      Debug.Write("strCurrent2(" & intFN & ") = " & strCurrent2(intFN) & Chr(13) & Chr(13) & Chr(13))
    6.      strCurrent = strCurrent & strCurrent2(intFN)
    7. Next
    8.  
    9. Debug.Write("strCurrent = " & strCurrent)

    Which produces this output (it's not necessary to read it really)

    strCurrent2(0) = HTTP/1.1 200 OK
    Server: GWS/2.0
    Date: Wed, 20 Feb 2002 06:05:20 GMT
    Transfer-Encoding: chunked
    Content-Type: text/html
    Cache-control: private
    Set-Cookie: PREF=ID=5e23ee4021c67533:TM=1014185120:LM=1014185120:S=3zWP4UCkpkM; domain=.google.com; path=/; expires=Sun, 17-Jan-2038 19:14:07 GMT

    87b
    <html>
    <head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=ISO-8859-1">
    <title>Google Search: APP </title>
    <style><!--
    body,td,div,.p,a{font-family:arial,sans-serif }
    div,td{color:#000}
    .f,.fl:link{color:#6f6f6f}
    a:link,.w,a.w:link,.w a:link{color:#00c}
    a:visited,.fl:visited{color:#551a8b}
    a:active,.fl:active{color:#f00}
    .t a:link,.t a:active,.t a:visited,.t{color:#ffffff}
    .t{background-color:#3366cc}
    .h{color:#3366cc;font-size:14px}
    .i,.i:link{color:#a90a08}
    .a,.a:link{color:#008000}
    .z{display:none}
    div.n {margin-top: 1ex}
    .n a{font-size:10pt; color:#000}
    .n .i{font-size:10pt; font-weight:bold}
    .q a:visited,.q a:link,.q a:active,.q {text-decoration: none; color: #00c;}
    .b{font-size: 12pt; color:#0

    strCurrent2(1) = r><font size=-1> <b>...</b> Copyright 1999-2002 by <b>APP</b> - Another PHP Programs<br> :: Kontakt: [email protected].
    <br><font color="#008000">www.php-zentrale.de/ - 19k - 19 Feb 2002 - <a class=fl href=/search?q=cache:Jv2kVoSEZnoC:www.php-zentrale.de/+APP&hl=en>Cached</a> - <a class=fl href=/search?hl=en&num=10&q=related:www.php-zentrale.de/>Similar pages</a></font></font>
    <p><a href=http://www.appg.com/>APP_Home_Page_EN</a><br><font size=-1> <b>...</b> About the Company Basic information about <b>APP</b>, its history and present. Who's<br> Who, internal structure and infrastructure info. Solutions and Services <b>APP</b> <b>...</b>
    <br><font color="#008000">www.appg.com/ - 19k - 19 Feb 2002 - <a class=fl href=/search?q=cache:OAPAx8uD02sC:www.appg.com/+APP&hl=en>Cached</a> - <a class=fl href=/search?hl=en&num=10&q=related:www.appg.com/>Similar pages</a></font></font>
    <p><a href=http://www.app.com/>www.app.com/</a><br><font size=-1><a class=fl href=/search?hl=en&num=10&q=related:www.app.com/>Simi

    strCurrent = HTTP/1.1 200 OK
    Server: GWS/2.0
    Date: Wed, 20 Feb 2002 06:05:20 GMT
    Transfer-Encoding: chunked
    Content-Type: text/html
    Cache-control: private
    Set-Cookie: PREF=ID=5e23ee4021c67533:TM=1014185120:LM=1014185120:S=3zWP4UCkpkM; domain=.google.com; path=/; expires=Sun, 17-Jan-2038 19:14:07 GMT

    87b
    <html>
    <head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=ISO-8859-1">
    <title>Google Search: APP </title>
    <style><!--
    body,td,div,.p,a{font-family:arial,sans-serif }
    div,td{color:#000}
    .f,.fl:link{color:#6f6f6f}
    a:link,.w,a.w:link,.w a:link{color:#00c}
    a:visited,.fl:visited{color:#551a8b}
    a:active,.fl:active{color:#f00}
    .t a:link,.t a:active,.t a:visited,.t{color:#ffffff}
    .t{background-color:#3366cc}
    .h{color:#3366cc;font-size:14px}
    .i,.i:link{color:#a90a08}
    .a,.a:link{color:#008000}
    .z{display:none}
    div.n {margin-top: 1ex}
    .n a{font-size:10pt; color:#000}
    .n .i{font-size:10pt; font-weight:bold}
    .q a:visited,.q a:link,.q a:active,.q {text-decoration: none; color: #00c;}
    .b{font-size: 12pt; color:#0
    Now if you'll notice, strCurrent is being appended to only once. I've been trying different things for almost 3 days now and have finally asked for someone's help.

    Any thoughts?
    Please rate my post.

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Ok this may be trivial, but what number is intTimes? it may be wrong there..
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    The value is 2 but we're going "intTimes - 1" so it's from 0-1.

    You can tell by the number inside the captions "0" and "1".


    strCurrent2(0) = HTTP/1.1 200 OK

    and

    strCurrent2(1) = r><font size=-1> <b>...</b
    Please rate my post.

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    try changing
    strCurrent = strCurrent & strCurrent2(intFN)

    to
    strCurrent += strCurrent2(intFN)
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Well Cander, that shouldn't matter...

    put 2 textboxes on a form and try this:
    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         TextBox1.Text = "Hello "
    3.         TextBox1.Text = TextBox1.Text & "VB.NET!"
    4.         Textbox2.Text = "Hello "
    5.         Textbox2.Text += "VB.NET!"
    6.     End Sub


    But again, trying won't hurt...
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  6. #6

    Thread Starter
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    I'll post the project that's making the calls ASAP. I've been having other variable problems like with the "-=" operator. I had six and after doing variable -= 1 I was returning 0. Makes no sense at all.

    What's worse is that I downloaded my version of VS.Net off MS when I had my Universal MSDN Subscription. It expired January (the month before the CD shipment came out).
    Please rate my post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width