I am getting very unusual results from a script. One set of results is returned if I place a ui_msg_box() line in the code... a different set of results is returned if I comment it out???!
Here is the part of the script that is giving the problem:
If I comment out this line:
ui_msg_box("Updated Gp Total For PlaceSponsor: "+str(CurrentPlaceSponsor,9,0),"PlaceSponsor: "+str(CurrentPlaceSponsor,9,0)+" Gp Total Has Been Updated To "+str(CurrentPlSpGpTotVal,9,2),UI_ATTENTION_SYMBOL+UI_OK)
I get one set of results ( the correct values)...
If I leave it uncomented I get another set of results ( incorrect values)
What is causing this?
How can I fix It
?
Here is the part of the script that is giving the problem:
Code:
tbl1 = Table.open("consultantscpovals",FILE_RW_SHARED) tbl2 = Table.open("consultantscpovals",FILE_RW_SHARED) tbl2.index_primary_put("Consultnum") tbl2.fetch_first() tbl1.fetch_first() '... step through each record in tbl1... get the Group total for the current record... '... index to Placesponsor record in tbl2 and add the two Group totals, then place the value in the grpcpospecifieddates field in tbl2 '... do this for every record in tbl1 while .NOT. tbl1.fetch_eof() TestConsNum = tbl1.consultnum 'Response = ui_msg_box("We Are At The Record For Consultant# "+alltrim(str(TestConsNum)),"We Are At The Record For Consultant# "+alltrim(str(TestConsNum)),UI_OK) CurrentPlaceSponsor = tbl1.placesponsor 'Get Placesponsor record in tbl2 tbl2.fetch_find(CurrentPlaceSponsor) CurrentGpTotal_1 = tbl1.grpcpospecifieddates CurrentGpTotal_2 = tbl2.grpcpospecifieddates PSponsorCurrentGpTot = CurrentGpTotal_1 + CurrentGpTotal_2 tbl2.change_begin() tbl2.grpcpospecifieddates = PSponsorCurrentGpTot tbl2.change_end(.t.) CurrentPlSpGpTotVal = tbl2.grpcpospecifieddates ui_msg_box("Updated Gp Total For PlaceSponsor: "+str(CurrentPlaceSponsor,9,0),"PlaceSponsor: "+str(CurrentPlaceSponsor,9,0)+" Gp Total Has Been Updated To "+str(CurrentPlSpGpTotVal,9,2),UI_ATTENTION_SYMBOL+UI_OK) tbl2.fetch_first() tbl1.fetch_next() end while tbl1.close() tbl2.close() end
If I comment out this line:
ui_msg_box("Updated Gp Total For PlaceSponsor: "+str(CurrentPlaceSponsor,9,0),"PlaceSponsor: "+str(CurrentPlaceSponsor,9,0)+" Gp Total Has Been Updated To "+str(CurrentPlSpGpTotVal,9,2),UI_ATTENTION_SYMBOL+UI_OK)
I get one set of results ( the correct values)...
If I leave it uncomented I get another set of results ( incorrect values)
What is causing this?
How can I fix It
?
Comment