168 of 318
ZBasic System Library 158 ZX Microcontroller Family MemFind Type Function returning UnsignedInteger Invocation MemFind(dataAddr, dataLen, val) MemFind(dataAddr, dataLen, val, ignoreCase) Parameter Method Type Description dataAddr ByVal array of Byte The address in RAM of the block to search. dataLen ByVal integral The length of the block to search. val ByVal Byte The byte value for which to search. ignoreCase ByVal Boolean A flag controlling whether alphabetic case is significant. Discussion This function attempts to find the first occurrence of the byte specified by the val parameter in a block of RAM beginning at the specified address. If it is found, the return value gives the 1-based index where the sought byte was found within the block. If the sought byte is not found, zero is returned. If the optional ignoreCase parameter is not given, the search is performed observing alphabetic case differences, otherwise alphabetic case differences are significant or not depending on the value specified for ignoreCase. For the purposes of this parameter only the characters A-Z and a-z (&H41 to &H5a and &H61 to &H7a) are considered to be alphabetic. Example Dim buf(1 to 40) as Byte Dim idx as UnsignedInteger ' search for a carriage return idx = MemFind(buf.DataAddress, Ubound(buf), &H0d) Compatibility This function is not available in BasicX compatibility mode. See Also ProgMemFind, StrFind