KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Removing elements from multiple arrays
PRODUCT: 4D | VERSION: 2004.1 | PLATFORM: Mac & Win
Published On: March 4, 2005

Version 2003 and 2004

The following method finds the target value in the array and remove it from the array. In additional to this functionality, the method will also delete the element in all arrays that are passed into the method

Code

For example:

ARRAY TEXT(Name_at;2)
ARRAY LONGINT(ID_al;2)
Name_at{1}:="English"
Name_at{2}:="French"
ID_al{1}:=1
ID_al{2}:=2

RemoveFromArrays(->FindStr;->Name_at;->ID_al) ` Where FindStr = "English"

Result: The element at position 1 of both arrays are removed. The size of the arrays is now 1.

Name_at{1}:="French"
ID_al{1}:=2