Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalent of VFP AT()?
Message
From
03/05/2002 13:51:45
Jason Dalio
Northern Interior Regional Health Board
Prince George, British Columbia, Canada
 
 
To
03/05/2002 13:37:18
Jason Dalio
Northern Interior Regional Health Board
Prince George, British Columbia, Canada
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00652048
Message ID:
00652522
Views:
25
Argh! I've gone brain dead on a Friday afternoon. To close to the weekend. I forgot the check if the nthOccurence doesn't exist:
Public Function PositionOfNthOccurence (nthOccurence as Integer, SearchString as String, SearchSubString as String) as Integer
Dim i as Integer
Dim CurrentPos as Integer
   
   CurrentPos = 0
   For i = 1 to nthOccurence
      PositionOfNthOccurence = Instr(CurrentPos + 1, SearchString, SearchSubString)
      If PositionOfNthOccurence <> 0 Then
         CurrentPos = PositionOfNthOccurence
      Else
         PositionOfNthOccurence = 0
         Exit Function
      End If
   Next 'i

End Function
Previous
Reply
Map
View

Click here to load this message in the networking platform