Source language: Translate to:

Recording the current position selected in an Array

General questions about NeoAppBuilder - our rapid application development tool for building HTML5, web and mobile apps.

Moderator: Neosoft Support

Recording the current position selected in an Array

Postby PaulTomo » Tue May 12, 2015 3:41 pm

While testing the new list & combo boxes, I have created some arrays from an online database using PHP script and the form action.
I have then saved the result into either a list or combo box but wanted to be able to Record current position in an Array of the result selected so it is possible to step forwards or backwards from that point with a push button that increases or decreases the count.

If I start at the first item or the last item, I can get the information I need but If there are 350 items in the array and one is selected in the middle, say the 125th item, is there any way to save that position to a variable?

I'll probably work it out with a clear mind tomorrow but any help is appreciated.

Thanks Again
User avatar
PaulTomo
 
Posts: 62
Joined: Tue Apr 28, 2009 1:15 am
Location: UK

Re: Recording the current position selected in an Array

Postby Neosoft Support » Wed May 13, 2015 2:06 pm

The variable associated with the Listbox will contain the text/value of the selected item. You can then use the ArraySearch action to find the index of that item in the array. Keep in mind that the index of the first item in the array is zero. ArraySearch returns -1 if no match is found.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to General NeoAppBuilder Discussion

Who is online

Users browsing this forum: No registered users and 1 guest