neoGetItemsNames - Forum

Forum Navigation
You need to log in to create posts and topics.

neoGetItemsNames

Hi, i am new in this forum. I'd like to know how to assign the result of the neoGetItemsNames to a variable to inspect it. Example:

neoGetItemsNames [name_DB] "routine_delay"
SetVar [first_position] [name_DB(0)]

but it doesn't work.
Thanks in advance

 

Hi @ema and welcome to the forum!

Please take a look at the attached sample (right click to save). The key point here is understanding these commands are asynchronous. This means the next command is executed even if the current one has not finished yet. That's the reason you should use callback subroutines, as they will allways be executed when the command has finished its work.

Regards.

PD: When pasting text from Google Translator use Shift-Ctrl-V instead of Ctrl-V so it is pasted without format.
Thank you!

Uploaded files:
  • You need to login to have access to uploads.
Vadim has reacted to this post.
Vadim

Many thanks Luis! Yor example is very useful. I'll try it right away. To try to solve the problem instead I had put an Wait instruction but it didn't work. Sorry for the incorrect copy from Google Translator :-(

Regards.

Great @ema, but using Wait is also possible. This works for me:

neoGetItemsNames [mylabels] ""
Wait 300
    SetVar [firstLabel] [mylabels(0)]
    AlertBox "First Label" "[mylabels(0)]" ""
EndWait

Regards.

Many thanks Luis! Sorry for my late answer. The problem was that I had forgotten the EndWait statement even though compiling it didn't give me errors.

The instructions about neoLocalStorage can generate different results in local storage of the browser if the program is running from VisualNEOWeb (call from browser button) or from compiled files (index.html, ecc.)?

Thanks in advance
Regards

Hi @ema

The instructions about neoLocalStorage can generate different results in local storage of the browser if the program is running from VisualNEOWeb (call from browser button) or from compiled files (index.html, ecc.)?

I don't understand your question, sorry.
neoLocalStorage plugin is based on LocalForage Javascrip Library and it uses the best option available in the current browser to store local data. It uses asynchronous storage (IndexedDB or WebSQL) or localStorage in browsers with no IndexedDB or WebSQL support. I hope it helps.

Best regards.

Hi Luis,

I apologize if I explained myself wrong. I wanted to know if the results (data stored in browser) can be different if the program is executed from the VisualNEO Web development environment or if the program is externally executed by VisualNEO Web.

I hope I explained myself.
Thanks in advance
Regards

@ema the way data is stored should be the same, but the actual data stored is dependant on the context. That means the browser will consider each piece of data stored to be owned by the app URL. So, if you execute your app under different domains or protocols (file:// http:// https://) the web browser will consider each one a different app and so tha data stored from one of them will be not accesible from the other one.

Does this answer your question?

Regards

Hi Luis,

your answer has clarified all my doubts. Thank you very much.

Regards