// -*- ASCII:EDT -*-
// %b\Config\EDT\dynamicUpdate.edt
// (schlicht 20030308)
/////////////////////////

IfStr("%$('dynamicKeywords_version');","1.3","<",`>
   IfFileExists("%b\Macros\macro\dynamicKeywords.edt","Exe('%b\Macros\macro\dynamicKeywords.edt');",>
      "IfFileExists('%B\Macros\macro\dynamicKeywords.edt','Exe(''%B\Macros\macro\dynamicKeywords.edt'');');");`);

// already a keyword?
IfStr("%$('EDT_update');","Assign","=",!`>
   IfFileExists("%b\Config\EDT\dynamicKeywords_Assign.dic",>
      "ReadFile('%b\Config\EDT\dynamicKeywords_Assign.dic',0);",>
      "LetReg(0,'');");>
   SetOK(1);>
   FindInString("%!0","%%%% for ""%p\%n%t""",1,2,0);>
   IfOK("","LetReg(0,'');");>
   SetOK(1);>
   FindInString("%?","\(0+[""""''|*:``]\)\(1*\)\0",1,2,1);>
   GetTag(1,1);>
   LetRegNum(3,-2);>
   Loop(!"SetOK(1);>
      FindInString('%!1','[""\\.+~*^@{}\[\]|?$<>""]',2,3,1001,%!3+2);>
      IfOK(!'InsertByIndex(1,""%!1"",""\"",%!2);','Stop;');>
   ");>
   FindInString("%!0","<%!1>",1,2,1);>
   IfOK("Release('EDT_update');Exit;");>
`);

// auxiliary function to remove '%$' (it would be regarded as a comment)
Assign("remove%$",!`>
   LetReg(0,"%$('dynamicKeywords_keywords');");>
   LetRegNum(2,0);>
   Loop(!"SetOK(1);>
      FindInString('%!0','<%%\$',1,2,1001,%!2);>
      IfOK(!'>
         ReplaceInString(''%!0'','''',%!1,%!2,0,0);>
      ','Stop;');>
   ");>
   Assign("dynamicKeywords_keywords","%!0");>
`);

IfStr("%$('EDT_update');","Assign","<>",>
   "DelKeyword('Dynamic EDT Local Regs');")// "Local Regs" must come after the "Assign" keywords!
// Assignments
Assign("dynamicKeywords_mode","EDT");
Assign("dynamicKeywords_type","Assign");
Assign("dynamicKeywords_HL_Settings","  Before:0EDT: Delimiter%\  After:0EDT: Delimiter%\  Enabled:1EDT%\  Strict Priority:0%\  Priority:8%\  Color:1025%\  Case Sensitive:1%\");
Do("%$('dynamicKeywords_from_GDI');");
Do("%$('remove%$');");
Do("%$('dynamicKeywords_fill_HL');");
Do("%$('dynamicKeywords_load_Dic');");
IfStr("%$('EDT_update');","Assign","=",!"Do('%$(|dynamicKeywords_update_HL|);');Release('EDT_update');Exit;");

// Local Regs and Release
Assign("dynamicKeywords_type","Local Regs");
Assign("dynamicKeywords_HL_Settings","  Before:0EDT: Delimiter%\  After:0EDT: Delimiter%\  Enabled:1EDT%\  Strict Priority:0%\  Priority:7%\  Color:5121%\  Case Sensitive:1%\");
Do("%$('dynamicKeywords_from_GDI');");
Do("%$('remove%$');");
Assign("dynamicKeywords_GDIPage","Release");
Assign("dynamicKeywords_moreKeywords","%$('dynamicKeywords_keywords');%\");
Do("%$('dynamicKeywords_from_GDI');");
Do("%$('remove%$');");
Do("%$('dynamicKeywords_fill_HL');");
Do("%$('dynamicKeywords_update_HL');");
Do("%$('dynamicKeywords_load_Dic');");

End;

$Id: sample.edt.html,v 1.0 2004-03-21 18:28:41+01 schlicht Exp schlicht $