Source language: Translate to:

Search Array

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

Moderator: Neosoft Support

Search Array

Postby TinTin » Thu Nov 19, 2015 2:15 pm

Hi all,

Can't seem to get this - adding to an array which is within a list box need to check if item is already in array

Example below..

Only works if I'm searching with a real string value (Pre defined) not a variable which can change at runtime..

Any help would be appreciated.

Cheers


SetVar [StringA] "One,Two,Three,Four"

StrParse "[StringA]" "," [Parsed]
SetVar [Combined] [Parsed(0)]+" - "+[Parsed(1)]
ArrayAddItem [Items] [Combined]


.// Search Array
ArraySearch [Items] "[Combined]" [Found]
TinTin
 
Posts: 162
Joined: Sun Dec 06, 2009 4:03 am
Location: UK

Re: Search Array

Postby Neosoft Support » Fri Nov 20, 2015 6:24 pm

Your code works, but you have to create the array before you can add items to it. For example:

.create empty array
CreateArray [Items] ""


SetVar [StringA] "One,Two,Three,Four"

StrParse "[StringA]" "," [Parsed]
SetVar [Combined] [Parsed(0)]+" - "+[Parsed(1)]
ArrayAddItem [Items] [Combined]

.// Search Array
ArraySearch [Items] "[Combined]" [Found
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
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 0 guests