Search for a string within the given array of strings.
in[] | string array | input array of strings to be searched |
active | integer | (Currently unused) sets module active/inactive |
ignore_whitespace | integer | sets Ignore Whitespace feature active/inactive |
search_string | string | string to be found in the given string array |
out | integer | output value specifying array element matching search string |
The FindStringInArray macro searches the given string array for the search string value and returns the array element matching the search string value. The macro also includes a UI Macro to provide a simple interface via a Text box to edit the search string, and Toggle button to enable/disable the Ignore Whitespace feature. The Ignore Whitespace feature is used to ignore whitespace padding at the beginning and end of the search string and array of strings.
in
The input string array for the FindStringInArray macro. The C++ function 'update' is used, inside the Functional Macro FindStringInArrayFunc, to search the string array for the given string.
active
(Currently unused) A member of the paramter block group (params), this integer value is used to activate/de-activate the module.
ignore_whitespace
A member of the parameter block group (params), this integer value is used to enable/disable the Ignore Whitespace feature.
search_string
A member of the parameter block group (params), this string value is used to search the given string array for a matching value.
out
The output value (out) specifies the array index which matches the given search string. This value is unset if the given search string is not found.
The User Macro FindStringInArray combines the functional macro FindStringInArrayFunc with the UI macro FindStringInArrayUI. The use of the common parameter block (params) provides a usable macro in the visualization library.
An example application FindStringInArrayEg is provided. There is an Input and an Output module attached to the main module. The input module contains a string array, and a UI module network which displays the list of strings in the array. The output module contains an integer primitive, and a UI module network which displays the output integer.
iac_proj/fstrarr/fsa_macs.v contains the Functional Macro FindStringInArrayFunc, the User Macro FindStringInArray, the UI Macro FindStringInArrayUI and the Example Application FindStringEg.
The FindStringInArrayMacs library inherits its process. As this library contains no procedural code, the process is not important.
Brian Selle, Leon Thrane Advanced Visual Systems, Inc.
Jon P. Davies Manchester Visualization Centre
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester UK M13 9PL
FindStringInArrayCore