Android Question If Starter.kvs.ContainsKey("key") ==> "missing parameter"

Discussion in 'Android Questions' started by FERNANDO SILVEIRA, Apr 5, 2018.

  1. FERNANDO SILVEIRA

    FERNANDO SILVEIRA Active Member Licensed User

    Hi there!

    I'm trying to check for an existing value stored before using it, according to the tutorial documentation, but the IDE points me a missing parameter.

    If the value is not stored I'm going to PUT it then.

    Any clues? BTW, the process was started on
    Code:
    [INDENT]Sub Service_Create
        kvs.Initialize(
    File.DirInternal, "datastore2")
    End Sub[/INDENT]
    Regards,
    Fernando

    upload_2018-4-4_22-57-59.png
     
    Last edited: Apr 5, 2018
  2. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    Code:
    If Starter.ckvs.ContainsKey(user,key) Then
          
    End If

    'User as String
    'Key as String
    'THEN key word
     
    Last edited: Apr 5, 2018
    BillMeyer likes this.
  3. FERNANDO SILVEIRA

    FERNANDO SILVEIRA Active Member Licensed User

    Thanx for the reply but tutorial documentation don't state user, only key value.
    What should I put in "user"?
    Code:
    'Tests whether a key is available in the store.
    Sub ContainsKey(Key As StringAs Boolean
     
  4. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

  5. Erel

    Erel Administrator Staff Member Licensed User

    Are you using CloudKVS or KVS2?
     
  6. FERNANDO SILVEIRA

    FERNANDO SILVEIRA Active Member Licensed User

    I'm playing with local KVS and relying on local KVS tutorial.
    So, probably I'm using the wrong set of libraries.

    :-(
     
  7. FERNANDO SILVEIRA

    FERNANDO SILVEIRA Active Member Licensed User

  8. BillMeyer

    BillMeyer Well-Known Member Licensed User

    Brothers, Brothers, Brothers,

    I can't believe you have all been caught out by this one - very, very obvious.....

    If {Statement} THEN
    Do Something
    Else
    do Something Else
    End If​

    So instead of:
    If Starter.kvs.ContainsKey(Uber)​

    it should be:
    If Starter.kvs.ContainsKey(Uber) THEN

    Don't worry - it happens !!

    Enjoy your Coding
     
    DonManfred likes this.
  9. FERNANDO SILVEIRA

    FERNANDO SILVEIRA Active Member Licensed User


    *LOL*:eek::eek:;)
    Man, you got it!
    Thanx a lot...

    Now let's see which the near steps brings me...
     
  10. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    I saw. I wrote above.

    'User as String
    'Key as String
    'THEN key word

    Next time I will put a banner and arrows.:D
     
    Dadaista, BillMeyer and DonManfred like this.
  11. Mahares

    Mahares Well Known Member Licensed User

    If he posted his code as text instead of a screenshot with a smorgasbord of colors, it would have been a lot easier to detect and someone would have delivered the correct answer immediately. That is why @Erel always recommends putting your code as text not a screenshot.
     
  12. DonManfred

    DonManfred Expert Licensed User

    In fact he GOT the correct answer in Post #2
     
  13. FERNANDO SILVEIRA

    FERNANDO SILVEIRA Active Member Licensed User

    FIXED!

    Lessons learned with this 1st complete application:
    1. To double check the syntax (even the most elementary)
    2. Reuse of stored data (KVS2)
    3. Use of tabs
    4. Use of RadioButtons
    5. Use of mailto to the default mail program
    6. Use of code /code [] tags when posting a thread
    BTW, I used to be a good Basic/VB programmer in the past, now I'm trying to recover my former status. :rolleyes:


    Thank you all...
     
    Eme Fibonacci and DonManfred like this.
  14. Mahares

    Mahares Well Known Member Licensed User

    That is true, but Fernando did not pick up the correct answer until post #9
     
  15. Mahares

    Mahares Well Known Member Licensed User

    One additional thing to add to your list:
    7. Never use a screenshot to post code. Use text so members who help you can manipulate it. Errors are a lot more detectable in text.
     
  16. FERNANDO SILVEIRA

    FERNANDO SILVEIRA Active Member Licensed User

    That's true.
    You were pointing the Moon and I was looking to the finger.
     
  17. Erel

    Erel Administrator Staff Member Licensed User

    +1

    And also searchable.
     
    FERNANDO SILVEIRA and BillMeyer like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice