Thank you for new version with the Block option.
Unfortunately Stop() function is giving error. Please advice.
Thank you.
a.
Code: Select all
Function SendReceivelistingArea();
{*******************************************}
{*** SEND LISTING AREA TO ENUMERATOR ****}
{*******************************************}
{*** IS FILE ALREADY CREATED OR NOT ****}
FindResult=fileexist(concat ("..\106_Ext_Data\AssignListing-", edit("9999999",Pro_Code), ".txt"));
{*******************************************}
{*** IF FILE IS NOT CREATED ****}
If Par_Designation =1 and FindResult=0 then
errmsg ("Listing Area [...Not Assigned/Non affecté...].");
move to PRO_SUP_ID
// stop(1);
else
{*******************************************}
{*** SYNCH ASSIGN LISTING ****}
If Par_Designation=2 then //If Enumerator login
filedelete(concat("..\106_Ext_Data\AssignListing-","*.txt"));
If syncserver (Bluetooth, "..") then // Get the Assigned Enumeration Area from the Supervisor
syncdisconnect();
errmsg ("Assigned Area Received [...%d...].",Pro_Code);
[u]stop(1);[/u]
else
move to PRO_SUP_ID;
endif;
elseif Par_Designation=1 then //If Supervisor login
if syncconnect(Bluetooth) then // Send the Assigned Enumeration Area to the Enumerator
syncfile(PUT, "..\106_Ext_Data\AssignListing-" + edit("9999999",Pro_Code) + ".txt", "/106_Ext_Data/");
syncdisconnect();
errmsg ("Assigned Area Send [...%d...].",Pro_Code);
move to PRO_SUP_ID;
else
move to PRO_SUP_ID;
endif;
endif;
endif;
end;