I am messing around with some small tables, and I wanted a simple way to assign keys. I wanted to calculate the current max key, incriment it and assign it to the new record. If I pass the name of the field as a parameter, I shold be able to use the following stored procedure as my insert trigger:
procedure SPKEY( pcFld )
local laMax(1), lcTbl
lcTbl=dbf()
select max( &pcFld ) from (lcTbl) into array laMax
replace (pcFld) with laMax(1)+1
return .t.
when I try and add a record, I get "Opperator/operand type mismatch"
, then "procedure canceled" , "Trigger failed" .
gaerrors (thank you Doug H.) does not have anyting in it, and if I run it from the command window, it works fine.
Can someone guide me as to how to debug shuch a thing? even if there is a better way to assign keys, which I would ofcourse allso be interested in.
Carl
ps thank you all who helped me figure out that outter join is not the same as full join.