Have a lotto application...
Need to update records in one table from the input to a second table...
Cannot find any way to do this on a field by field basis, so I figure that I have to do it with the OnSave event????
Much rather do it as each field is entered, cuz then it's only one small script activated as the field is entered; as opposed to a longer script that must read each field individually and then act.... maybe in a loop ????
BUT just spent the better part of an hour going thru the XBasic Reference and I cannot find what I 'think' I am looking for...
Here's the scenario....
Winning number data: date is entered and then 6 fields.
Need to take each field value (ie 18), access a second table, add one (1) to a running count number for that field value AND then repeat for each of the remaining 5 fields... It was rather easy using the 'Read' command in A4.....
here's my 'cobolized' xbasic.....?????
assuming all the 'dim' statements are valid....
dim fld[6] as N
tbl1=table.open("db-name")
tbl2=table.open("db1-name")
tbl1.fetch_last()
for i = 1 to 6
var1=fld[i].value_get()
tbl2.fetch(var1)
count = count + 1
next i
var1 in this case is both the number value and the record number...
tbl2 is already established with all counts initialized to zero.
then close both tables
Need to update records in one table from the input to a second table...
Cannot find any way to do this on a field by field basis, so I figure that I have to do it with the OnSave event????
Much rather do it as each field is entered, cuz then it's only one small script activated as the field is entered; as opposed to a longer script that must read each field individually and then act.... maybe in a loop ????
BUT just spent the better part of an hour going thru the XBasic Reference and I cannot find what I 'think' I am looking for...
Here's the scenario....
Winning number data: date is entered and then 6 fields.
Need to take each field value (ie 18), access a second table, add one (1) to a running count number for that field value AND then repeat for each of the remaining 5 fields... It was rather easy using the 'Read' command in A4.....
here's my 'cobolized' xbasic.....?????
assuming all the 'dim' statements are valid....
dim fld[6] as N
tbl1=table.open("db-name")
tbl2=table.open("db1-name")
tbl1.fetch_last()
for i = 1 to 6
var1=fld[i].value_get()
tbl2.fetch(var1)
count = count + 1
next i
var1 in this case is both the number value and the record number...
tbl2 is already established with all counts initialized to zero.
then close both tables
Comment