pfc_propertysyntax


pfcutil.pbl   >   pfc_u_tabpg_dwproperty_srvmultitable   >   pfc_propertysyntax   

Full name pfc_u_tabpg_dwproperty_srvmultitable.pfc_propertysyntax
Access public
Extend of
Return value
Prototype event pfc_propertysyntax()

Name Datatype
No Data

Name Datatype
lb_keyinplace boolean
li_cnt integer
li_index integer
li_keysubscript integer
li_rc integer
li_row integer
li_rowcount integer
li_tablecnt integer
li_updatesubscript integer
li_upper integer
li_whereoption integer
lnv_conversion n_cst_conversion
ls_column string
ls_keycolumns string
ls_syntax string
ls_table string
ls_tables string[]
ls_updatecolumns string

event pfc_propertysyntax;call super::pfc_propertysyntax;//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		pfc_propertysyntax
//
//	Access:    		Public
//
//	Arguments:  	None
//
//	Returns:   		String
//	  The syntax required to create the currently selections.
//   '!' in error
//
//	Description:  
//	Create the required syntax to match the current selections.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.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.
//
//////////////////////////////////////////////////////////////////////////////

integer	li_rowcount
integer	li_row
integer 	li_rc
integer	li_tablecnt
integer	li_whereoption
integer	li_keysubscript
integer	li_updatesubscript
string	ls_table, ls_column
string	ls_syntax
string	ls_keycolumns
string	ls_updatecolumns
string	ls_tables[]
boolean	lb_keyinplace

n_cst_conversion lnv_conversion

integer	li_upper
integer	li_cnt

integer	li_index


// Validate references.
If IsNull(idw_requestor) or Not IsValid(idw_requestor) Then
	Return '!'
End If
If IsNull(idw_requestor.inv_multitable) or Not IsValid(idw_requestor.inv_multitable) Then
	Return '!'
End If

// -- Define needed variables. --
ls_syntax += 'String ls_keycolumns[]~r~n'
ls_syntax += 'String ls_updatecolumns[]~r~n'
ls_syntax += 'String ls_initialize[]~r~n'
ls_syntax += '~r~n'

// -- Start the service. --
ls_syntax += 'This.of_SetMultitable(True)~r~n'

// Get all the Tables.
li_rc = idw_requestor.inv_multitable.of_GetRegisterableTable(ls_tables)

// Loop around all tables.
li_tablecnt = UpperBound(ls_tables)
For li_cnt = 1 to li_tablecnt

	// Get one table.
	ls_table = ls_tables[li_cnt]	
	
	// Initialize.
	ls_keycolumns = '// Key columns for "'+ls_table+'". ~r~nls_keycolumns = ls_initialize~r~n'
	ls_updatecolumns = '// Update columns for"'+ls_table+'". ~r~nls_updatecolumns = ls_initialize~r~n'
	li_keysubscript = 0
	li_updatesubscript = 0
	
	// Set the internal data to the table.
	li_rowcount = of_SetData(ls_table)
	If li_rowcount <= 0 Then Continue
	
	// Determine if this table needs to be registered.
	If Upper(ids_data.object.pfc_register.primary[1]) = 'N' Then
		// Table will not be registered.
		Continue
	End If
	
	// Get the data from the main row.
	lb_keyinplace = (Upper(ids_data.object.pfc_keyinplace.primary[1]) = 'Y')
	li_whereoption = ids_data.object.pfc_whereoption.primary[1]

	// Loop around all the columns.
	For li_row = 1 to li_rowcount

		// Get the column name.
		ls_column = ids_data.object.pfc_column.primary[li_row]
		
		// Determine if this is a key column.
		If Upper(ids_data.object.pfc_key.primary[li_row]) = 'Y' Then
			//If li_keysubscript > 0 Then ls_keycolumns += '~r~n'
			li_keysubscript ++
			ls_keycolumns += 'ls_keycolumns['+string(li_keysubscript)+']' + &
				'="'+ls_column+'" ~r~n'		
		End If
		
		// Determine if this is a Update column.
		If Upper(ids_data.object.pfc_update.primary[li_row]) = 'Y' Then
			//If li_updatesubscript > 0 Then ls_updatecolumns += '~r~n'
			li_updatesubscript ++
			ls_updatecolumns += 'ls_updatecolumns['+string(li_updatesubscript)+']' + &
				'="'+ls_column+'" ~r~n'			
			End If
	Next

	// Add the arrays.
	ls_syntax += '~r~n'
	ls_syntax += ls_keycolumns
	ls_syntax += '~r~n'
	ls_syntax += ls_updatecolumns
	
	// -- Register. --
	ls_syntax += '~r~n// Register "'+ls_table+'"~r~n'
	ls_Syntax += 'This.inv_multitable.of_Register("'+ls_table + &
		'", ls_keycolumns, ls_updatecolumns, '+lnv_conversion.of_String(lb_keyinplace)+&
		', '+String(li_whereoption)+')~r~n'
		
Next

Return ls_syntax

end event

     
Name Owner
No Data

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.string systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_conversion.of_string pfc_n_cst_conversion
pfc_n_cst_dwsrv_multitable.of_GetRegisterableTable pfc_n_cst_dwsrv_multitable
pfc_u_tabpg_dwproperty_srvmultitable.of_setdata pfc_u_tabpg_dwproperty_srvmultitable
pfc_u_tabpg_dwproperty_base.pfc_propertysyntax pfc_u_tabpg_dwproperty_base

     
Full name
No Data

     
Name Scope
No Data