123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- $PBExportHeader$f_account_array.srf
- global type f_account_array from function_object
- end type
- forward prototypes
- global subroutine f_account_array (string arg_accountstr)
- end prototypes
- global subroutine f_account_array (string arg_accountstr);Long ll_cnt,cnt
- String ls_accountstr
- Long ll_account
- Long local_account[]
- ll_cnt = 0
- ls_accountstr = arg_accountstr
- IF Trim(arg_accountstr) = '' Or Trim(arg_accountstr) = '-1' THEN
- local_account[1] = 0
- ELSE
- IF sys_power_issuper Or arg_accountstr = '0' THEN
-
- SELECT count(*) INTO :cnt
- From u_accounts;
- IF sqlca.SQLCode <> 0 Or cnt = 0 THEN
- ll_cnt++
- local_account[ll_cnt] = 0
- ELSE
- DECLARE cur_plugins CURSOR FOR
- SELECT u_accounts.accountsid
- FROM u_accounts
- where ifuse = 1
- Order By u_accounts.accountsid Desc;
-
- OPEN cur_plugins;
- FETCH cur_plugins Into :ll_account;
- DO WHILE sqlca.SQLCode = 0
- ll_cnt++
- local_account[ll_cnt] = ll_account
- FETCH cur_plugins Into :ll_account;
- LOOP
-
- CLOSE cur_plugins;
- END IF
- ELSE
- DO WHILE Len(ls_accountstr) <> 1
- ls_accountstr = Replace( ls_accountstr, 1, 1, '' )
- ll_account = Long(Left(ls_accountstr,Pos(ls_accountstr,',',1) - 1))
- ll_cnt++
- local_account[ll_cnt] = ll_account
-
- ls_accountstr = Replace ( ls_accountstr, 1, Pos(ls_accountstr,',',1) - 1, '' )
- LOOP
- END IF
- END IF
- sys_user_account = local_account
- end subroutine
|