By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!myecho ^e^[
v:\> alias myecho `%@if[%@len[%$] LT 1000,echo %$,echo %$]`
v:\> myecho ^e[92mfoo
TCC: Syntax error "@len[^e[92mfoo"
v:\> alias myecho `%@if[%@len[%$] LT 1000,echo %$,echo bar]`
v:\> myecho ^e[92mfoo
TCC: Syntax error "@len[^e[92mfoo"
v:\> alias myecho `%@if[%@len[%$] LT 1000,echo bar,echo bar]`
v:\> myecho ^e[92mfoo
bar
Yes, after your example I think that too.
Oh, that's very interesting and good "debugged"!It only seems to happen when there are multiple occurrences of %$ in the alias definition, one being in a function.
Code:v:\> alias myecho `%@if[%@len[%$] LT 1000,echo %$,echo %$]` v:\> myecho ^e[92mfoo TCC: Syntax error "@len[^e[92mfoo" v:\> alias myecho `%@if[%@len[%$] LT 1000,echo %$,echo bar]` v:\> myecho ^e[92mfoo TCC: Syntax error "@len[^e[92mfoo" v:\> alias myecho `%@if[%@len[%$] LT 1000,echo bar,echo bar]` v:\> myecho ^e[92mfoo bar
v:\> alias myecho `set z=%$ & %@if[%@len[%$] NE 0,echo %$,echo %$]`
v:\> myecho [
TCC: Syntax error "@len[["
v:\> alias myecho `set z=%$ & %@if[%@len[%z] NE 0,echo %z,echo %z]`
v:\> myecho [
[
So what's the difference between these? They're the same except that the first uses %$ inside %IF and the second uses %z?
Code:v:\> alias myecho `set z=%$ & %@if[%@len[%$] NE 0,echo %$,echo %$]` v:\> myecho [ TCC: Syntax error "@len[[" v:\> alias myecho `set z=%$ & %@if[%@len[%z] NE 0,echo %z,echo %z]` v:\> myecho [ [