GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Overview
The FindInString function scans a string for a target string and returns its position. The function has options to begin its search from a specific location, specify case sensitivity or to search in look back mode.
Syntax/Parameters
Syntax
int = FindInString ( string source, string match, [int position, [dword flags]] );
int = FindInString ( wstring source, wstring match, [int position, [dword flags]] );
Parameters
source
A string or wstring to search.
match
A string or wstring to find within the source. The match parameter must match the source parameter type.
position
An optional int containing a zero-based starting position. By default, the search begins at the start of the string (position = 0).
flags
An optional dword to specify options:
TRUE = case-sensitive
FALSE = case-insensitive
By default, the search is case-insensitive. See remarks for additional flags.
Return Value
Returns an int containing the zero-based starting position within source where match was found or -1 on an error. Use the GetLastError function to retrieve error information.
Remarks
Unlike the InString function, the FindInString functions offers greater control over the search mechanics. Specifically, it permits a starting search position and case-sensitivity to be specified. However, this function does not allow searching for a specific character, which makes it a less ideal tool for finding white space, word space, or other special characters within a string. A boolean version of this function is available as the IsInString function.
If match is not found within source, the GetLastError function will return ERROR_EOD. If the position is outside the length of source, the GetLastError function will return ERROR_RANGE.
The flags parameter specifies two options:
FIS_NOT_CASE_SENSITIVE 0x00000000 Find without Case Sensitivity, same as FALSE, default
FIS_CASE_SENSITIVE 0x00000001 Find with Case Sensitivity
FIS_LOOK_BACK 0x00010000 Scan Backwards (reverse)
Case-insensitive matching is performed on a locale basis as set by Windows. For US, on ASCII matching is the only case matching performed.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.