Start Back Next End
  
ZBasic System Library
232
ZBasic Microcontrollers
ProgMemFind
Type
Function returning UnsignedInteger
Invocation
ProgMemFind(dataAddr, dataLen, val) 
ProgMemFind(dataAddr, dataLen, val, ignoreCase) 
Parameter
Method
Type
Description
dataAddr
ByVal
Long
The address in Program Memory 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
data in Program Memory 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 charSet as ByteVectorData ({ ".$%'-_@~`!(){}^#&" })
Dim inCharSet as Boolean
If (ProgMemFind(charSet.DataAddress, SizeOf(charSet), c) <> 0) Then
inCharSet = True
End If
Compatibility
This function is not available in BasicX compatibility mode.  
See Also
Previous page Top Next page