|
of_lastpos
|
|
Full name
|
pfc_n_cst_string.of_lastpos
|
Access
|
public
|
Extend of
|
long
|
Return value
|
long
|
Prototype
|
public function long of_lastpos(string,string,long)
|
Name
|
Datatype
|
ll_Cnt
|
Long
|
ll_Pos
|
Long
|
public function long of_lastpos (string as_source, string as_target, long al_start);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_LastPos
//
// Access: public
//
// Arguments:
// as_Source The string being searched.
// as_Target The being searched for.
// al_start The starting position, 0 means start at the end.
//
// Returns: Long
// The position of as_Target.
// If as_Target is not found, function returns a 0.
// If any argument's value is NULL, function returns NULL.
//
// Description: Search backwards through a string to find the last occurrence
// of another string.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
Long ll_Cnt, ll_Pos
//Check for Null Parameters.
IF IsNull(as_source) or IsNull(as_target) or IsNull(al_start) Then
SetNull(ll_Cnt)
Return ll_Cnt
End If
//Check for an empty string
If Len(as_Source) = 0 Then
Return 0
End If
// Check for the starting position, 0 means start at the end.
If al_start=0 Then
al_start=Len(as_Source)
End If
//Perform find
For ll_Cnt = al_start to 1 Step -1
ll_Pos = Pos(as_Source, as_Target, ll_Cnt)
If ll_Pos = ll_Cnt Then
//String was found
Return ll_Cnt
End If
Next
//String was not found
Return 0
end function
Name
|
Owner
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
systemfunctions.pos |
systemfunctions
|
systemfunctions.setnull |
systemfunctions
|