locked
Code help RRS feed

  • Question

  • I need help getting a code that would make the following work.

    If ob.value is greater than or equal to 12.0 and does not exceed 14.9 and river.text = "CHEMUNG RIVER AT ELMIRA" then impact.text = a text file located at "C:\Users\Carter Humphreys\SkyDrive\AWIPS\AHPS\Flood Impacts\Chemung River at Elmira\At 12 feet.txt"

    Thanks to everyone and anyone who can help!

    Saturday, May 4, 2013 8:26 PM

Answers

  • Hi,

     You can try this. Being i don`t know how the text file is set up and i don`t know if imact.txt is a textbox or what i would say this should be close.

            If ob.Value >= 12.0 And ob.Value <= 14.9 And river.Text = "CHEMUNG RIVER AT ELMIRA" Then
                impact.Text = System.IO.File.ReadAllText("C:\Users\Carter Humphreys\SkyDrive\AWIPS\AHPS\Flood Impacts\Chemung River at Elmira\At 12 feet.txt")
            End If
    

    • Marked as answer by Carter_N349NB Saturday, May 4, 2013 8:46 PM
    Saturday, May 4, 2013 8:41 PM

All replies

  • Hi,

     You can try this. Being i don`t know how the text file is set up and i don`t know if imact.txt is a textbox or what i would say this should be close.

            If ob.Value >= 12.0 And ob.Value <= 14.9 And river.Text = "CHEMUNG RIVER AT ELMIRA" Then
                impact.Text = System.IO.File.ReadAllText("C:\Users\Carter Humphreys\SkyDrive\AWIPS\AHPS\Flood Impacts\Chemung River at Elmira\At 12 feet.txt")
            End If
    

    • Marked as answer by Carter_N349NB Saturday, May 4, 2013 8:46 PM
    Saturday, May 4, 2013 8:41 PM
  • Thanks
    Saturday, May 4, 2013 8:46 PM
  • Personally, I don't think they deserve politeness.

    What you think isn't important.  The standard you are asked to maintain is what matters:

    "Please don't:
    ...
    Harass, insult, tease, or correct other users about the grammar used in their posts. Good or bad grammar isn't the point-the forums are about getting questions answered."

    (http://answers.microsoft.com/en-us/Page/faq#faqCodeConduct3)

    Monday, May 6, 2013 2:48 AM
  • "Harass, insult, tease, or correct other users about the grammar used in their posts. Good or bad grammar isn't the point-the forums are about getting questions answered."

    Here's my rule. If a person uses the word "codes" they can count on a response from me.  " Good or bad grammar isn't the point-the forums are about" is about Microsoft maximizing their profit.

    Renee


    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me


    Renee,

    You will abide by the community rules or be excommunicated by the community.  Your choice.

    Please take this as an official warning to follow the forum guidelines and to stop harassing posters over their grammar.  Filling threads with comments about your personal feelings only bogs down the forums and provides a benefit to no one.

    This has gone on long enough.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Monday, May 6, 2013 7:29 PM