>>create table pp ; >> ( field1 c(2) default '**' ; >> ) >>>>
>>=dbsetprop('pp.Field1', 'Field', 'DefaultValue', '**') >>>>
*--------------------------------------------------------------------------- *-------------------------------------------------------------------------- function View_FieldProperties_Set(ViewName) && view supposed to be used local nTables, TableList[1] local nFields, FieldList[1] local i, j, TableFieldName, ViewFieldName, xx nFields = afields( FieldList, ViewName) nTables = ViewTables(ViewName, @TableList) for i = 1 to nTables for j = 1 to nFields TableFieldName = TableList[i] + '.' + FieldList[j, 1] ViewFieldName = ViewName + '.' + FieldList[j, 1] do case case indbc(TableFieldName, 'Field') xx = dbgetprop(TableFieldName, 'Field', 'Caption') =dbsetprop(ViewFieldName, 'Field', 'Caption', xx) xx = dbgetprop(TableFieldName, 'Field', 'InputMask') =dbsetprop(ViewFieldName, 'Field', 'InputMask', xx) xx = dbgetprop(TableFieldName, 'Field', 'Format') =dbsetprop(ViewFieldName, 'Field', 'Format', xx) xx = dbgetprop(TableFieldName, 'Field', 'DefaultValue') =dbsetprop(ViewFieldName, 'Field', 'DefaultValue', xx) endcase endfor endfor endfunc *-------------------------------------------------------------------------- function ViewTables(ViewName, ArrayName) external array ArrayName local n, TableList n = 0 do case case !indbc(ViewName, 'View') && ignore otherwise TableList = dbgetprop(ViewName, 'View', 'Tables') TableList = strtran(TableList, ',', chr(0x0a)) n = alines(ArrayName, TableList, TRUE) && may hav dups, do not care endcase return n endfunc *---------------------------------------------------------------------------