Findelement method – MagTek USB HID Swipe Reader User Manual
Page 21

Section 3. Methods
17
FINDELEMENT METHOD
Returns particular information after parsing out specific card data, based on parameters selected
by the user.
Syntax
Result =USBHID.FindElement (ByVal TrackNum As Integer, ByVal RefChar As String, ByVal
Displacement As Integer, ByVal NumDigits As String, [DirectionBack As Variant]) As String
Part
Description
TrackNum
See Values From GetTrack method.
RefChar
The Character to Reference - Can also include multiples (e.g., ^^) would
indicate Reference Character is the second ^.
Displacement
Number of Digits to Displace.
NumDigits
The Length or Terminating Character - Can also include multiples (e.g., = = =)
would indicate Terminating Character is the Third =.
DirectionBack The Direction to Travel. This parameter is optional.
Example
Assume CardData =
‘%B1234567890123456^CARD/TEST^9912101?;1234567890123456=9912101?
USBHID.FindElement(2,”;”,0,”=”) would return ‘1234567890123456’
USBHID.FindElement(2,”;”,0,”16”) would return ‘1234567890123456’
USBHID.FindElement(1,”^”,0,”^^”) would return ‘CARD/TEST’
USBHID.FindElement(1,”^”,0,”/”) would return ‘CARD’
DirectionBack: If omitted DirectionBack is False (Left to Right) when specifying a reference
character of anything but an End Sentinel (?). If the Reference Character is an End Sentinel then
DirectionBack is True (Right to Left). If specified, then the actual value takes precedence.
Data Type
String