Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. trygetvalue? Please help

trygetvalue? Please help

Scheduled Pinned Locked Moved C#
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    honeyman_can
    wrote on last edited by
    #1

    string translationText = ""; if(dicText.TryGetValue(translation[r].EntryCode, out translationText)) { dicText.Add(translation[r].EntryCode, translationText); } I don't get this method. As far as I understand it, it should do one lookup and if found then assign the related value of "translation[r].EntryCode" to translationText. Is this correct?

    E L 2 Replies Last reply
    0
    • H honeyman_can

      string translationText = ""; if(dicText.TryGetValue(translation[r].EntryCode, out translationText)) { dicText.Add(translation[r].EntryCode, translationText); } I don't get this method. As far as I understand it, it should do one lookup and if found then assign the related value of "translation[r].EntryCode" to translationText. Is this correct?

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      TTFCAFO or RTFM or STFW or ... Just type the code and time it and see what works best. Thats what we do when we don't know the answer.

      A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

      1 Reply Last reply
      0
      • H honeyman_can

        string translationText = ""; if(dicText.TryGetValue(translation[r].EntryCode, out translationText)) { dicText.Add(translation[r].EntryCode, translationText); } I don't get this method. As far as I understand it, it should do one lookup and if found then assign the related value of "translation[r].EntryCode" to translationText. Is this correct?

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        honeyman_can wrote:

        Is this correct?

        If you mean TryGetValue(..), yes. You should continue your original thread on a topic rather than starting new ones every few hours.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups