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

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
B4X:
[INDENT]Sub Service_Create
    kvs.Initialize(File.DirInternal, "datastore2")
End Sub[/INDENT]

Regards,
Fernando

upload_2018-4-4_22-57-59.png
 
Last edited:

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
B4X:
If Starter.ckvs.ContainsKey(user,key) Then
      
End If

'User as String
'Key as String
'THEN key word
 
Last edited:
Upvote 0

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"?
B4X:
'Tests whether a key is available in the store.
Sub ContainsKey(Key As String) As Boolean
 
Upvote 0

BillMeyer

Well-Known Member
Licensed User
Longtime 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
 
Upvote 0

FERNANDO SILVEIRA

Active 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


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

Now let's see which the near steps brings me...
 
Upvote 0

Eme Fibonacci

Well-Known Member
Licensed User
Longtime 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

I saw. I wrote above.

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

Next time I will put a banner and arrows.:D
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I can't believe you have all been caught out by this one - very, very obvious...
*LOL*:eek::eek:;)
Man, you got it!
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.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime 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.
In fact he GOT the correct answer in Post #2
 
Upvote 0

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...
 
Upvote 0
Top