of_getcolumneditstatus


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_find   >   of_getcolumneditstatus   

Full name pfc_n_cst_dwsrv_find.of_getcolumneditstatus
Access protected
Extend of string
Return value string
Prototype protected function string of_getcolumneditstatus(string,long)

Name Datatype
No Data

Name Datatype
EDITABLE_COLUMN string
ls_columnprotect string
ls_evaluate string
ls_evaluateresult string
PROTECTED_COLUMN string
READONLY_COLUMN string

protected function string of_getcolumneditstatus (string as_column, long al_row);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_GetColumnEditStatus
//
//	Access:  		protected
//
//	Arguments:		
//	as_column		The column to test.
//	al_row			The row number to test.
//
//	Returns:  		String
//						"editable" The column/row is editable.
//						"displayonly" The column/row is display only
//						"protected" The column/row is not editable.
//						"!" if an error is encountered.
//
//	Description: 	Determine the Edit Status of the passed column/row 
//						combination.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////

constant string EDITABLE_COLUMN = 'editable'
constant string READONLY_COLUMN = 'readonly'
constant string PROTECTED_COLUMN= 'protected'
string	ls_columnprotect
string	ls_evaluate
string	ls_evaluateresult

//Check arguments
If IsNull(as_column) or Len(Trim(as_column))=0 or &
	IsNull(al_row) or al_row <=0 Then
	Return '!'
End If

//////////////////////////////////////////////////////////////////////////////
// If the TabSequence for the column is not Greater than Zero then 
//	the field is protected.
//////////////////////////////////////////////////////////////////////////////
If idw_requestor.Describe(as_column+".TabSequence") = '0' Then
	Return PROTECTED_COLUMN
End If

//////////////////////////////////////////////////////////////////////////////
// If the Protected attribute for the column/row evaluates to One then
// the field is protected.
//////////////////////////////////////////////////////////////////////////////
ls_columnprotect = idw_requestor.Describe(as_column+".Protect")

//Get rid of extra quotes.
If Left(ls_columnprotect, 1) = "'" or Left(ls_columnprotect, 1) = '"' Then
	ls_columnprotect = Mid(ls_columnprotect, 2)
	If Right(ls_columnprotect, 1) = "'" or Right(ls_columnprotect, 1) = '"' Then
		ls_columnprotect = Mid(ls_columnprotect, 1, Len(ls_columnprotect)-1 )
	End If
End If

If IsNumber (ls_columnprotect) Then
	If Long(ls_columnprotect) <> 0 Then
		Return PROTECTED_COLUMN
	End If
Else
	//Get the expression and evaluate it.
	ls_evaluate = 'Evaluate ("'+Mid(ls_columnprotect, 3)+'",'+string(al_row)+')'
	ls_evaluateresult = idw_requestor.Describe(ls_evaluate)
	If IsNumber(ls_evaluateresult) Then
		If Long(ls_evaluateresult) <> 0 Then
			Return PROTECTED_COLUMN
		End If
	Else
		Return PROTECTED_COLUMN
	End If
End If

//////////////////////////////////////////////////////////////////////////////
// If the Edit.DisplayOnly for the column is Yes then the field is ReadOnly.
//////////////////////////////////////////////////////////////////////////////
If idw_requestor.Describe(as_column+".Edit.DisplayOnly") = "yes" Then
	Return READONLY_COLUMN
End If

//////////////////////////////////////////////////////////////////////////////
// If None of the above then the field is editable.
//////////////////////////////////////////////////////////////////////////////
Return EDITABLE_COLUMN
end function

     
Name Owner
pfc_n_cst_dwsrv_find.of_find pfc_n_cst_dwsrv_find
pfc_n_cst_dwsrv_find.pfc_replace pfc_n_cst_dwsrv_find

     
Name Owner
datawindow.describe datawindow
systemfunctions.isnull systemfunctions
systemfunctions.isnumber systemfunctions
systemfunctions.left systemfunctions
systemfunctions.len systemfunctions
systemfunctions.long systemfunctions
systemfunctions.mid systemfunctions
systemfunctions.mid systemfunctions
systemfunctions.right systemfunctions
systemfunctions.string systemfunctions
systemfunctions.trim systemfunctions

     
Full name
No Data

     
Name Scope
No Data