'================================================ ==============
'Function name: getpaing
'Usage: retrieve pagination
'================================================ ==============
Function getpaing (byval constr, startstr, overstr, inclul, inclur)
If constr = "$ false $" or constr = "" Or startstr = "" Or overstr = "" Or isnull (constr) = true or isnull (startstr) = true or isnull (overstr) = true then
Getpaing = "$ false $"
Exit Function
End if
Dim start, over, Contemp, tempstr
Tempstr = lcase (constr)
Startstr = lcase (startstr)
Overstr = lcase (overstr)
Over = instr (1, tempstr, overstr)
If over <= 0 then
Getpaing = "$ false $"
Exit Function
Else
If inclur = true then
Over = over + Len (overstr)
End if
End if
Tempstr = mid (tempstr, 1, over)
Start = Limit Rev (tempstr, startstr)
If inclul = false then
Start = start + Len (startstr)
End if
If start <= 0 or start> = over then
Getpaing = "$ false $"
Exit Function
End if
Contemp = mid (constr, start, over-start)
Contemp = trim (Contemp)
Contemp = Replace (Contemp ,"","")
Contemp = Replace (Contemp ,",","")
Contemp = Replace (Contemp ,"'","")
Contemp = Replace (Contemp ,"""","")
Contemp = Replace (Contemp, "> ","")
Contemp = Replace (Contemp, "<","")
Contemp = Replace (Contemp ,"","")
Getpaing = Contemp
End Function