PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: mice - usb devices  (Read 528 times)

raymw

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 193
Re: mice - usb devices
« Reply #15 on: September 24, 2018, 06:57:38 AM »

Thanks Pierre, for taking an interest. I'll pick over what you have written, see if I can get it to something like it in freebasic. I really appreciate your help.
Best wishes,

Ray
Logged

Pierre Bellisle

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 81
Re: mice - usb devices
« Reply #16 on: September 26, 2018, 03:21:52 PM »

I may have some FB code for you soon...

Later...
Both previous posts
September 24, 2018, 12:30:44 AM
and
September 24, 2018, 12:31:22 AM
have been updated and translated to fb.
« Last Edit: September 26, 2018, 09:05:01 PM by Pierre Bellisle »
Logged

raymw

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 193
Re: mice - usb devices
« Reply #17 on: October 02, 2018, 04:23:37 PM »

Hi Pierre, thanks, I didn't  notice you'd converted it to fb, until I got your pm.
Logged

Pierre Bellisle

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 81
Re: mice - usb devices
« Reply #18 on: October 02, 2018, 11:03:57 PM »

The FieldGet() function was a paste from a bad template.
It is now updated in my previous main code post.
It should looks more like this...

Code: [Select]
'______________________________________________________________________________

Function FieldGet(ByVal sData As String, ByVal sSplit As String, ByVal FieldTarget As Long) As String
 Dim ChrPos     As Long = 1
 Dim SplitPos   As Long
 Dim FieldIndex As Long

 If Len(sData) * Len(sSplit) Then                       'Both string lenght must be non zero
   Do                                                   'Loop for every field
     SplitPos = InStr(ChrPos, sData, sSplit)            'Get split position, use InStr/ANY if needed
     FieldIndex += 1                                    'Increment field  count
     If FieldIndex = FieldTarget Then                   'Wanted field index
       If SplitPos = 0 THEN SplitPos = Len(sData) + 1   'Unique or last field
       Function = Mid(sData, ChrPos, SplitPos - ChrPos) 'Return data
       Exit Do                                          'Job done
     End If
     ChrPos = SplitPos + Len(sSplit)                    'Prepare for possible next search
   Loop While SplitPos                                  'Done if no more found
 End If

End Function
'_____________________________________________________________________________
'
Logged
Pages: 1 [2]