Home » U++ Library support » U++ Library : Other (not classified elsewhere) » ESC macro problem
ESC macro problem [message #52185] |
Tue, 06 August 2019 16:16  |
slashupp
Messages: 231 Registered: July 2009
|
Experienced Member |
|
|
linux, svn 13505
I'm writing a macro and is trying to use either lambda or fn to create callable sub-routines
but find that ESC-functions like GetCursor() and Find() is not available in either.
If I put all the code in the macro itself it works fine, but has a lot of repeating code.
1. What must I do to have access to the ESC-functions within either a lambda or an fn?
2. Also, what is the 'instance' refered to in:
Quote:. lambda(args) ! instance | Invokes lambda, using instance as instance for lambda execution (accessible via .name or self).
Below demonstrates the issue:
macro "PROBLEM" Ctrl+F8
{
ClearConsole();
cp = GetCursor();
A = "STD";
B = "COUT";
//this works fine...
#:cat(a, b, &x) { x = a + ">>>>>" + b; }
c = "error";
:cat(A, B, c);
cout(c);
//this fails with: [..] 'SetCursor' is not a lambda
#:test(a, b)
{
SetCursor(0);
if (Find("std::cout", 1, 1))
{
f = GetSelBegin();
l = GetSelCount();
SetCursor(f);
Remove(l);
s = a + "::" + b;
Insert(s);
}
}
:test(A, B);
SetCursor(cp);
}
thx
[Updated on: Tue, 06 August 2019 17:14] Report message to a moderator
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri May 09 20:20:14 CEST 2025
Total time taken to generate the page: 0.02989 seconds
|