It would be nice to have more array functions, such as Insert, Delete items, Clone (duplicate) array, Set upper|lower bounds, ReDim, etc... It would be looking like this:
ArrayInsert "[ArrVariable]" "[Index]" "[Data]" - insert item and shift array indexes
ArrayDelete "[ArrVariable]" "[Index]" - delete item and shift array indexes
ArrayErase "[ArrVariable]" - deletearray
ArrayCopy "[ArrVariable]" "[NewArrVariable]" - copy array into new array
ArrayGet "[ArrVariable]" "[UppBound]" "[LowBound]" "[ArrCount]" - getarrayinfo
ArraySet "[ArrVariable]" "[UppBound]" "[LowBound]" "[ArrCount]" - some kind of redim with preserving data
ArraySort "[ArrVariable]" "ASCEND / DESCEND" - sort array (as string data)
ArrayFind "[ArrVariable]" "[DataToSearch]" "[ItemIndex]" - returns item index (0 if no hits) or array of indexes (if multiple hits)
and (imho) it looks more "professional" and comfortable than manipulating with hidden listbox and additional plugins, isn't it?
More array functions
Moderator: Neosoft Support
Re: More array functions
Tony Kroos:
1) Not sure if HPW, dec or David de Argentina already have such functionality within one their plugins.
2) Javascript has a rich set of "array processing methods" ... so one could build a NeoBook Function Library whose functions (written in Javascript) can be Call'ed from any of your publications.
However, since I don't see a method of passing NeoBook Array Variable to such Functions, one would have to do an "Array to Delimiter Separated String" conversion ... and pass the String to the (javascript) Functions.
This can be done with native NeoBook Actions inside a Loop/EndLoop block ... but might take long for huge arrays.
Would be nice to have a native NeoBook command for this ... like ...
... a kind of reverse of StrParse ... could have an "option" parameter to indicate whether "empty/missing array items should be ignored or not"
1) Not sure if HPW, dec or David de Argentina already have such functionality within one their plugins.
2) Javascript has a rich set of "array processing methods" ... so one could build a NeoBook Function Library whose functions (written in Javascript) can be Call'ed from any of your publications.
However, since I don't see a method of passing NeoBook Array Variable to such Functions, one would have to do an "Array to Delimiter Separated String" conversion ... and pass the String to the (javascript) Functions.
This can be done with native NeoBook Actions inside a Loop/EndLoop block ... but might take long for huge arrays.
Would be nice to have a native NeoBook command for this ... like ...
Code: Select all
ArrayToString "array name" "start index" "end index" "item delimiter" "string variable"
ArrayToString "[country]" "1" "999999" "!@#$%^" "[countryList]"
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Re: More array functions
Hello,
On the other hand maybe an interesting option is to use my npStrs plugin, which allow you to work with objects which contains "list of strings" (similar to Arrays) in various ways, allowing add, append, insert, delete, copy, find, locate, sort, avoid duplicates, deal with keys/values, load/save to/from file, etc., etc., etc..
My npUtil plugin is the "swiss knife" of my plugins, and, can be a good place to count with some Array related actions, in the same way than other categories like "Strings utils", "File utils", etc., etc. However, the NeoBook SDK do not provide too much stuff in order to deal with Arrays, as I can remember right now. Anyway I will to investigate this in the near future.Gaev wrote: 1) Not sure if HPW, dec or David de Argentina already have such functionality within one their plugins.
On the other hand maybe an interesting option is to use my npStrs plugin, which allow you to work with objects which contains "list of strings" (similar to Arrays) in various ways, allowing add, append, insert, delete, copy, find, locate, sort, avoid duplicates, deal with keys/values, load/save to/from file, etc., etc., etc..
You can use the "DeleteArray" action to do this.Tony Kroos wrote: ArrayErase "[ArrVariable]" - deletearray
Last edited by dec on Fri Aug 22, 2014 2:09 pm, edited 4 times in total.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.