$PBExportHeader$f_open_win.srf global type f_open_win from function_object end type forward prototypes global function integer f_open_win (long arg_scid, string arg_code) end prototypes global function integer f_open_win (long arg_scid, string arg_code);//arg_w_name 可为空 s_edit_index_tran s_tran s_tran.work_mode = 0 s_tran.arg_pkid = 0 s_tran.arg_string_code = arg_code s_tran.c_long = arg_scid s_tran.d_long = 2 s_tran.if_retrieve_all = local_retrieve_all String ls_scname,ls_sccode String ls_space Int li_spacenum String ls_d_string Boolean if_f IF arg_scid = -1 THEN Long i, ll_scid String ls_code, ls_char ls_code = Reverse (arg_code) FOR i = 1 To Len(ls_code) IF Not IsNumber(Mid(ls_code, i, 1)) THEN EXIT END IF NEXT ls_sccode = Reverse (Mid(ls_code, i, 2)) SELECT scid INTO :ll_scid FROM u_scdef Where sccode = :ls_sccode; IF sqlca.SQLCode <> 0 THEN ll_scid = 0 END IF arg_scid = ll_scid END IF SELECT scname,sccode INTO :ls_scname,:ls_sccode FROM u_scdef Where scid = :arg_scid; IF sqlca.SQLCode <> 0 Or IsNull(ls_scname) THEN ls_scname = '' li_spacenum = 50 - Len(Trim(ls_scname)) - 2 - Len(String(arg_scid)) ls_space = Fill(' ',li_spacenum) ls_d_string = ls_scname+ls_space+'['+String(arg_scid)+']' s_tran.d_string = ls_d_string String ls_billcode,ls_win1,ls_win2 ls_billcode = Mid(Trim(arg_code),Len(ls_sccode) + 1,2) SELECT win1,win2 INTO :ls_win1,:ls_win2 FROM u_billcode Where firststr = :ls_billcode; IF sqlca.SQLCode <> 0 THEN if_f = False ELSE if_f = True END IF IF Not if_f THEN SELECT win1,win2 INTO :ls_win1,:ls_win2 FROM u_billcode Where oldfirststr = :ls_billcode; IF sqlca.SQLCode <> 0 THEN if_f = False ELSE if_f = True END IF END IF IF if_f THEN window openwin OpenWithParm(openwin,s_tran,ls_win1) END IF RETURN 1 end function