Howdy. I am not a programmer so bare with me.
I am trying to setup a GLOBAL change operation for various fields in my database. I will use an example, Equipment # is used in about 15 dbfs but that field is NOT always given the same name. No prob.
I've got a button with a dialogue where I enter the OLD equipment and then the NEW one. These become variables in my search and replace script.
After doing a lot of cut/paste which seemed to give me what I wanted. I get the "Symbol Multiply Defined" error when I click the button to start the script.
It appears that the problem is around the goto
****typical script for changing the equipment # in the prassig.dbf"
a_tbl = table.open("prassig")
ON ERROR GOTO ERROR15122006212543000
DIM a5_operation_order as C
a5_operation_order = ""
query.order = a5_operation_order
DIM a5_operation_filter as C
a5_operation_filter = ".T."
query.filter = a5_operation_filter
query.options = "I"
query.description = "Temporary Query"
i_indx = a_tbl.query_create("N")
update.fields = 1
update.field1 = "Equipno"
update.expr1 = "STRITRAN(Equipno,VAR->CEN,VAR->NEN)"
'Prompt for confirmation before running the Operation.......
dim rec_count as n
rec_count = a5_get_records_in_query("prassig",a5_operation_filter,-1,.f.)
message_text = rec_count + " record(s) from 'prassig' will be updated."+crlf(2)+ "OK to proceed?"
operation_result=ui_msg_box("Update Operation",message_text,UI_OK_CANCEL+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
If operation_result <> ui_ok_selected then
end
end if
a_tbl.update()
GOTO CONTINUE15122006212543000
ERROR15122006212543000:
ON ERROR GOTO 0
ui_msg_box("Error","Error running Update Operation"+crlf()+error_text_get())
END
CONTINUE15122006212543000:
a_tbl.close()
'Display a dialog box showing the results of the Operation
'(If last parameter is blank, button to show result is not displayed).
a5_update_op_result(a_records_processed, a_records_violated,"prassig",a5_operation_filter)
'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
*******************
since I cut/paste & revised the field names & dbf in the above, I ended up with all these various ACTIONS having the same goto continue # as above.
Example: above "GOTO CONTINUE15122006212543000" is the same in each action.
What the heck do these do, can I just ADD my own #? I experimented and made up my own number & it seemed to have done the trick as I no longer get the "symbol multiply defined" error.
If this does not make sense, please ask and I will attempt to answer your ?
BIG thanks.
DeWayne
I am trying to setup a GLOBAL change operation for various fields in my database. I will use an example, Equipment # is used in about 15 dbfs but that field is NOT always given the same name. No prob.
I've got a button with a dialogue where I enter the OLD equipment and then the NEW one. These become variables in my search and replace script.
After doing a lot of cut/paste which seemed to give me what I wanted. I get the "Symbol Multiply Defined" error when I click the button to start the script.
It appears that the problem is around the goto
****typical script for changing the equipment # in the prassig.dbf"
a_tbl = table.open("prassig")
ON ERROR GOTO ERROR15122006212543000
DIM a5_operation_order as C
a5_operation_order = ""
query.order = a5_operation_order
DIM a5_operation_filter as C
a5_operation_filter = ".T."
query.filter = a5_operation_filter
query.options = "I"
query.description = "Temporary Query"
i_indx = a_tbl.query_create("N")
update.fields = 1
update.field1 = "Equipno"
update.expr1 = "STRITRAN(Equipno,VAR->CEN,VAR->NEN)"
'Prompt for confirmation before running the Operation.......
dim rec_count as n
rec_count = a5_get_records_in_query("prassig",a5_operation_filter,-1,.f.)
message_text = rec_count + " record(s) from 'prassig' will be updated."+crlf(2)+ "OK to proceed?"
operation_result=ui_msg_box("Update Operation",message_text,UI_OK_CANCEL+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
If operation_result <> ui_ok_selected then
end
end if
a_tbl.update()
GOTO CONTINUE15122006212543000
ERROR15122006212543000:
ON ERROR GOTO 0
ui_msg_box("Error","Error running Update Operation"+crlf()+error_text_get())
END
CONTINUE15122006212543000:
a_tbl.close()
'Display a dialog box showing the results of the Operation
'(If last parameter is blank, button to show result is not displayed).
a5_update_op_result(a_records_processed, a_records_violated,"prassig",a5_operation_filter)
'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
*******************
since I cut/paste & revised the field names & dbf in the above, I ended up with all these various ACTIONS having the same goto continue # as above.
Example: above "GOTO CONTINUE15122006212543000" is the same in each action.
What the heck do these do, can I just ADD my own #? I experimented and made up my own number & it seemed to have done the trick as I no longer get the "symbol multiply defined" error.
If this does not make sense, please ask and I will attempt to answer your ?
BIG thanks.
DeWayne
Comment