insert into macroheader values ('MAIL PROCESS','Look at mail file',0,0,0); insert into macrodetail values ('MAIL PROCESS',1,37,'',NULL,'Process mail file',1,''); insert into macrodetail values ('MAIL PROCESS',2,16,'',NULL,'if(ph_filelength("C:\Program Files\powerhome\Custom\outputIndex.txt") > 0, 1, 999)',0,''); insert into macrodetail values ('MAIL PROCESS',3,15,'[LOCAL1]',NULL,'ph_readfile("C:\Program Files\powerhome\Custom\outputIndex.txt")',0,''); insert into macrodetail values ('MAIL PROCESS',4,38,'',0,'ph_deletefile("C:\Program Files\powerhome\Custom\outputIndex.txt")',0,''); insert into macrodetail values ('MAIL PROCESS',5,26,'',NULL,'OPEN MAILS',0,''); insert into macrodetail values ('MAIL PROCESS',6,27,'',NULL,'if (len("[LOCAL1]") <5, "The End", "Continue")',0,''); insert into macrodetail values ('MAIL PROCESS',7,26,'',NULL,'Continue',0,''); insert into macrodetail values ('MAIL PROCESS',8,15,'[LOCAL2]',NULL,'pos("[LOCAL1]", char(13) + char(10))',0,''); insert into macrodetail values ('MAIL PROCESS',9,38,'',0,'if(number("[LOCAL2]") > 0, ph_and( ph_setsystemvar("LOCAL3", left("[LOCAL1]", (number("[LOCAL2]") - 1)) ), ph_setsystemvar("LOCAL1", mid("[LOCAL1]", (number("[LOCAL2]") + 2)) ) ) , ph_and( ph_setsystemvar("LOCAL3", "[LOCAL1]"), ph_setsystemvar("LOCAL1", "") ) )',0,''); insert into macrodetail values ('MAIL PROCESS',10,15,'[LOCAL4]',NULL,'ph_readfile("[LOCAL3]")',0,''); insert into macrodetail values ('MAIL PROCESS',11,15,'[LOCAL5]',NULL,'ph_macroparmret("MAIL COMMANDS", upper("[LOCAL4]"), "", "", "", "")',0,''); insert into macrodetail values ('MAIL PROCESS',12,15,'[LOCAL6]',NULL,'ph_replaceall(ph_replaceall(ph_replaceall(string(today()), "/", "-"), ":", "-"), " ", ".") + ".txt"',0,''); insert into macrodetail values ('MAIL PROCESS',13,38,'',0,'if (number("[LOCAL5]") = 0, ph_movefile("[LOCAL3]", "C:\PROGRA" +char(126) + "1\POWERH"+char(126) +"1\Custom\Mail-Error\" + "[LOCAL6]") , ph_movefile("[LOCAL3]", "C:\PROGRA" +char(126) + "1\POWERH"+char(126) +"1\Custom\Mail-Proccessed\" + "[LOCAL6]") )',0,''); insert into macrodetail values ('MAIL PROCESS',14,15,'[LOCAL3]',NULL,'""',0,''); insert into macrodetail values ('MAIL PROCESS',15,27,'',NULL,'"OPEN MAILS"',0,''); insert into macrodetail values ('MAIL PROCESS',16,26,'',NULL,'The End',0,'');