The below code gets 2 values from arrays and then I try to set them to local storage options
The result of the options is not proper. The Key values are not created. They are blank in the browser dev tools window.
The first value for [crew_id] is not set (it has a value) and the value for [crew_name] does get set in local storage.
I hope everything goes fine for you and yours. I can't reproduce the problem that you mention. The below code works as expected:
Note that the last argument must be "String".
Amazing, sometimes my 2 year old will walk over and start typing on my keyboard! Must be what happened. I will test again. Thanks
Here is my test
DebugAlert is my own function
All values are present in my alerts. Only the SetOption for crew lead id is getting set right. The other two are not setting at all
Maybe you already use a variable name "current_crew_name" or "current_crew_lead_id" previously used in the app? It's the only think that I can think right now... so you can maybe try with options names like "__current_crew_name" and "__current_crew_lead_id", just to assert that that names are not already used for any variable in the app.
it was a variable naming issue
Thanks for your help and I hope you are staying healthy under these strange times
No problem! And the same for you and yours, Ryan, stay safe! :-/
If a local storage option does not hold a value or does not exist, will it be null or undefined?
If the option that we are trying to get do not exists what we get is an empty string.
So I could check it with StrLen or see if it is ""
Yes; both ways can be fine.
Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.