I have only been scripting for a short time so when I get stuck, I will use the script recorder to help me through. I know that sometimes you need to use pointers, etc to make a saved script from the recorder work for you along with other changes. I have been working on a Summarization and while it works fine from the summary card, after I record it with the script recorder and make the necessary changes that I think will work, it doesn't. I keep getting messages on the last command that say "Invalid summary field type" or "No such field", depending on how I change the actual command that tells it to do the summary operation.Here is the script from the recorder:
tbl = table.current()
sum.db = "monthly.DBF"
sum.db_dd_delete = .F.
sum.order = "ATTORNEY"
sum.filter = "BETWEEN(BILLING_DATE,{06/01/2002},{06/30/2002})"
sum.options = "I"
sum.fields = 2
sum.field1 = "Attorney"
sum.code1 = 0
sum.field2 = "Citylist->Price"
sum.code2 = 1
tbl.summarize()
:DefaultBrowse_MONTHLY.activate()
and here is my modified script:
dim tbl as P
debug(1)
tbl=table.open("ameregl1.dbf")
sum.db = "monthly.DBF"
sum.db_dd_delete = .F.
sum.order = "ATTORNEY"
sum.filter = "BETWEEN(BILLING_DATE,{06/01/2002},{06/30/2002})"
sum.options = "I"
sum.fields = 2
sum.field1 = "Attorney"
sum.code1 = 0
sum.field2 = "Citylist->Price"
sum.code2 =1
tbl.summarize()
tbl=table.close()
END
I have tried many different combo's but cannot make it work as if run from the card. Note I do have a "debug" in it and this is how I determined where it's hanging up. Also, the table "Citylist.dbf" is another table that is part of the set. Should I try opening that also? I tried it before but it made no difference. I am extremely open to any suggestions. Thanks!!!
Scott Naples
tbl = table.current()
sum.db = "monthly.DBF"
sum.db_dd_delete = .F.
sum.order = "ATTORNEY"
sum.filter = "BETWEEN(BILLING_DATE,{06/01/2002},{06/30/2002})"
sum.options = "I"
sum.fields = 2
sum.field1 = "Attorney"
sum.code1 = 0
sum.field2 = "Citylist->Price"
sum.code2 = 1
tbl.summarize()
:DefaultBrowse_MONTHLY.activate()
and here is my modified script:
dim tbl as P
debug(1)
tbl=table.open("ameregl1.dbf")
sum.db = "monthly.DBF"
sum.db_dd_delete = .F.
sum.order = "ATTORNEY"
sum.filter = "BETWEEN(BILLING_DATE,{06/01/2002},{06/30/2002})"
sum.options = "I"
sum.fields = 2
sum.field1 = "Attorney"
sum.code1 = 0
sum.field2 = "Citylist->Price"
sum.code2 =1
tbl.summarize()
tbl=table.close()
END
I have tried many different combo's but cannot make it work as if run from the card. Note I do have a "debug" in it and this is how I determined where it's hanging up. Also, the table "Citylist.dbf" is another table that is part of the set. Should I try opening that also? I tried it before but it made no difference. I am extremely open to any suggestions. Thanks!!!
Scott Naples
Comment