How come that the <tbl>.Change() works but the <tbl>.post() throws up the error "Variable post.m_exp1 references a non-existant field"
The two tables have identical fields and definitions
The variables are set by the script thus:
the code for <TBL>.Change
The code for <TBL>.POST()
I know I can use the <TBL>.Change(), but I would like to learn how to get the tbl.post() working.
thanks in anticipation
The two tables have identical fields and definitions
The variables are set by the script thus:
Code:
. . LOG = Table.open("Logging") RSP = Table.open("RSP_Data") . . . SELECT CASE log.reg <> rsp.reg ValueOldReg = log.reg ValueNewReg = rsp.reg IF isblank("log.old_id") THEN ValueOld_id = ValueOldReg ELSE ValueOld_id = rtrim(Log.Old_Id)+","+ValueOldReg END IF CASE log.reg = rsp.reg ValueNewReg = "" ValueOldReg = "" ValueOld_Id = "" END SELECT
the code for <TBL>.Change
Code:
log.change_begin(.t.) log.reg = if(ut(ValueNewReg) = "",Log.reg,ValueNewReg) log.old_id = if(ut(ValueOld_Id) = "",Log.old_id,ValueOld_Id) log.Icao_code = if(ut(rsp.icao_code) = "",Log.icao_Code,Rsp.Icao_code) log.op_unique = if(ut(rsp.op_unique) = "",Log.op_unqiue,rsp.op_unique) log.code = if(ut(rsp.code) = "",Log.code,rsp.Code) log.status = if(ut(rsp.status) = "",Log.status,rsp.status) log.change_end(.t.)
Code:
post.t_db = "D:\My Databases\SBS\data\RSP_Data.DBF" post.m_key = "TYPE_CODE-MSN" post.t_key = "TYPE_CODE-MSN" post.m_filter = "" post.t_filter = "" post.m_count = 6 post.m_field1 = "Reg" post.m_exp1 = "if(ut(ValueNewReg) = \"\",Log.reg,ValueNewReg)" post.m_field2 = "Old_Id" post.m_exp2 = "if(ut(ValueOld_Id) = \"\",Log.old_id,ValueOld_Id)" post.m_field3 = "icao_code" post.m_exp3 = "if(ut(@rsp_Data->icao_code) = \"\",Log.icao_Code,@Rsp_Data->Icao_code)" post.m_field4 = "op_unique" post.m_exp4 = "if(ut(@rsp_data->op_unique) = \"\",Log.op_unqiue,@rsp_data->op_unique)" post.m_field5 = "code" post.m_exp5 = "if(ut(@rsp_data->code) = \"\",Log.code,@rsp_data->Code)" post.m_field6 = "status" post.m_exp6 = "if(ut(@rsp_data->status) = \"\",Log.status,@rsp_data->status)" post.t_count = 1 post.t_case1 = "POSTED" post.t_field1 = "@Rsp_Data->Flag" post.t_exp1 = "\"Posted\"" log.post()
I know I can use the <TBL>.Change(), but I would like to learn how to get the tbl.post() working.
thanks in anticipation
Comment