Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » ESC macro problem
ESC macro problem [message #52185] Tue, 06 August 2019 16:16 Go to previous message
slashupp is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: thread bug....and fix
Next Topic: SOLVED: icon no longer shows
Goto Forum:
  


Current Time: Fri Apr 19 01:49:34 CEST 2024

Total time taken to generate the page: 0.02731 seconds