There is a conflict in the procedure exec_ during the call to dequote, it is not the one of utilib.pas which is executed but that of main.pas with them MARKER_QUOTE.
I suggest you to rename the 'dequote' in main.pas by 'macrodequote' and move it at same place of 'macroquote'
you have to change all calls to 'dequote' in procedure 'cbmacros' by the 'macrodequote' excepted in the procedure exec_()
After that, there will not be possible confusion anymore
I take advantage of it to add a boolean function
function isAnyMacroIn(s:string):boolean; inline;
begin result:=pos(MARKER_OPEN, s) > 0 end;
function noMacrosAllowed(s:string):string; inline;
begin result:=if_(not isAnyMacroIn(s), s) end; // prevent hack attempts
function macroQuoted(s:string):boolean; // add by mars
begin
s:=trim(s);
result:=ansiStartsStr(MARKER_QUOTE, s) and ansiEndsStr(MARKER_UNQUOTE, s);
end;
function macroQuote(s:string):string;
var
t: string;
begin
if not anyMacroMarkerIn(s) then
begin
result:=s;
exit;
end;
// an UNQUOTE would invalidate our quoting, so let's encode any of it
t:=MARKER_UNQUOTE;
replace(t, '&#'+intToStr(charToUnicode(t[1]))+';', 1,1);
result:=MARKER_QUOTE+xtpl(s, [MARKER_UNQUOTE, t])+MARKER_UNQUOTE
end; // macroQuote
function macrodequote(s:string):string; //moved from dequote
begin
result:=s;
s:=trim(s);
if ansiStartsStr(MARKER_QUOTE, s) and ansiEndsStr(MARKER_UNQUOTE, s) then
result:=copy(s, length(MARKER_QUOTE)+1, length(s)-length(MARKER_QUOTE)-length(MARKER_UNQUOTE) );
end; // macrodequote
function loadDescriptionFile(fn:string):string;
begin
result:=loadFile(fn);
if result = '' then
result:=loadFile(fn+'\descript.ion');
if (result > '') and mainfrm.oemForIonChk.checked then
OEMToCharBuff(@result[1], @result[1], length(result));
end; // loadDescription
Le premier qui me demande à quoi cela va servir, il n'a qu'à attendre la sortie de la build 240, c'est en rapport avec la macro 'no pipe'. Rejetto, j'espère que tu te montreras assez curieux pour me contacter:
le problème du | est résolu et fonctionnel j'allais oublier une dernière modification à main.pas.
if name = 'add to log' then
begin
try mainfrm.add2log(macrodequote(p), md.cd, stringToColor(par(1,'color')) );
except mainfrm.add2log(macrodequote(p), md.cd) end;
result:='';
end;
then {.add to log|{:{.one macro.}:}.} add '{.one macro.}' to the log and not '{:{.one macro.}:}' or the reuslt of '{.one macro.}' if you ommit the macroquote.
The second solution, the simplest but remaining ambigue
procedure exec_();
var
s: string;
begin
s:=utilLib.dequote(par(1)); //marsmars
if fileOrDirExists(s) then
s:=quoteIfAnyChar(' ', s);
try
setVar(parEx('out'), captureExec(utilLib.dequote(p)+' '+s)); //marsmars
spaceIf(TRUE);
except spaceIf(exec(utilLib.dequote(p), s)) end; //marsmars
end; // exec_