//=======================================
// 根据字数设置列宽度
//---------------------------------------
// 字体枚举宽度(宋体)
// 8 号-16 号
//---------------------------------------
// idw_data$为要处理的数据窗对象
//=======================================
string ls_syntax
string ls_object_ag
string ls_object[]
long ll_count
long ll_pos_start,ll_pos_name,ll_pos_space
Integer li_len, li_row, j, i, li_size, li_column, li_MaxLen
String ls_text, ls_column,ls_name
//Integer li_font[8 TO 16] = {29, 32, 34, 39, 42, 43, 48, 50, 52}
Integer li_font[8 TO 16] = {25, 28, 30, 34, 36, 40/*13*/, 44, 47/*15*/, 50}
//a.这样才是最佳效果
string ls_col_compute[] , ls_col_compute_single
long ll_compute_count , ll_compute_index
Integer li_compute_len
//得到数据窗中所有[计算列]名称列表
If Not isValid(idw_data$) Then Return -1
ls_syntax = idw_data$.Describe("DataWindow.Syntax")
ls_syntax = lower(trim(ls_syntax))
ls_object_ag = 'compute('
if isnull(ls_syntax) or ls_syntax = '' then return -1
ll_pos_start = 1 //
do
//1.找到某个对象在 syntax 中的起始位置
ll_pos_start = pos(ls_syntax,ls_object_ag,ll_pos_start)
if ll_pos_start<=0 then exit
//2.得到名称标志的位置
ll_pos_name = pos(ls_syntax,' name=',ll_pos_start)
if ll_pos_name<=0 then
ll_pos_name = pos(ls_syntax,'(name=',ll_pos_start)
if ll_pos_name<=0 then exit
end if
//3.得到名称标志后第一个空格
ll_pos_space = pos(ls_syntax,' ',ll_pos_name)
if ll_pos_space<=0 then exit
评论0
最新资源