The following script worked for years (in all builds up to and through 1491_1048). In all builds later than 1491_1048 indexes seem to have no control or use in scripts.
Any ideas on how to make this script work again would be appreciated
'Debt accounts array 11/2/00
dim tbl as p
dim t_accts as p
dim t_companies as p
dim NewPmarker as c
tbl = table.current()
t_accts = table.open("accounts")
IF tbl.mode_get() " 0 THEN
END
END IF
on error goto fix_error
search:
'------
dim f_search as c
dim compid as c
dim x as n
dim cbid as c
dim who as c
t_accts.index_primary_put("compname")
t_accts.fetch_first()
t_accts.fetch_find(clntid)
count = calc-"no_accts
s_num = count
dim search(s_num) as c
i = 0
WHILE t_accts.client_id = clntid
i = i + 1
search(i) = left(t_accts.compname,15) +" - "+ remspecial(t_accts.acctnumber) +space(60)+ t_accts.pmarker
t_accts.fetch_next(2)
IF t_accts.fetch_eof()
EXIT WHILE
END IF
END WHILE
sort_array("search")
t_accts.close()
t_acct= table.get("accounts")
continue:
'--------
ui_beep(64)
found1 = ui_get_list_array("Client has "+str(s_num -1,3)+" accounts", 1, "search")
IF found1 = "" THEN
Debt_System_Browse.fetch_first()
parent.resynch()
ELSE
found = clntid+left(found1,10)
t_acct.index_primary_put("compname")
t_acct.fetch_first()
t_acct.fetch_find(found)
Debt_System_Browse.activate()
Debt_System_Browse.resynch()
END IF
t_acct.index_primary_put("client_id")
END
fix_error:
'---------
resume next
Any ideas on how to make this script work again would be appreciated
'Debt accounts array 11/2/00
dim tbl as p
dim t_accts as p
dim t_companies as p
dim NewPmarker as c
tbl = table.current()
t_accts = table.open("accounts")
IF tbl.mode_get() " 0 THEN
END
END IF
on error goto fix_error
search:
'------
dim f_search as c
dim compid as c
dim x as n
dim cbid as c
dim who as c
t_accts.index_primary_put("compname")
t_accts.fetch_first()
t_accts.fetch_find(clntid)
count = calc-"no_accts
s_num = count
dim search(s_num) as c
i = 0
WHILE t_accts.client_id = clntid
i = i + 1
search(i) = left(t_accts.compname,15) +" - "+ remspecial(t_accts.acctnumber) +space(60)+ t_accts.pmarker
t_accts.fetch_next(2)
IF t_accts.fetch_eof()
EXIT WHILE
END IF
END WHILE
sort_array("search")
t_accts.close()
t_acct= table.get("accounts")
continue:
'--------
ui_beep(64)
found1 = ui_get_list_array("Client has "+str(s_num -1,3)+" accounts", 1, "search")
IF found1 = "" THEN
Debt_System_Browse.fetch_first()
parent.resynch()
ELSE
found = clntid+left(found1,10)
t_acct.index_primary_put("compname")
t_acct.fetch_first()
t_acct.fetch_find(found)
Debt_System_Browse.activate()
Debt_System_Browse.resynch()
END IF
t_acct.index_primary_put("client_id")
END
fix_error:
'---------
resume next
Comment