Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get text with a specific color (user functions) from the QM code editor
#1
After using QM for a long time, I’ve created a large number of regular and member functions. Since my programming skills are not very advanced, these functions are frequently modified.

When I share macro scripts that use these functions with my friends, I always have to save the functions being used into .txt files and send them manually. Then they have to open those .txt files and check and replace the functions one by one — it’s truly a nightmare.
 
Today, I made a new discovery: the text of the function names I want to export always appears in the same color (0xF08000) in the QM code editor, as shown in the image below.
https://i.ibb.co/6RR9FQp8/qm.jpg

So, is there any way to extract the text of these function names?
After obtaining these function name texts, I can exclude those starting with sub. — what's left are the regular functions and member functions that I want to export.
However, I still need to determine whether each one is a member function, because some regular and member functions share the same name, as shown in the example code below.

I’ve posted about this issue before, and it has been bothering me for a long time.
Thanks in advance for any suggestions or help!

Macro Macro1
 
Code:
Copy      Help
out

out Function1(1) ;;Regular functions: Need to export

_s="hello"
out _s.Function1("world") ;;Member functions: Need to export

out sub.Function1(_s) ;;Sub-functions: No need to export

#sub Function1
function~ str's
ret s

Function Function1
 
Code:
Copy      Help
function a
ret a+1

Member function str.Function1
Code:
Copy      Help
function~ str's
ret F"{this} {s}"

If the above regular functions and member functions could be exported as an xx.qml file, and then, when importing on another computer, there was a button that could directly replace existing functions with the same names, it would be incredibly convenient—just like shown in the image below. I’m not sure whether the "QM File Viewer" has its source code publicly available.

https://i.ibb.co/nqTxFSV3/im.jpg


Messages In This Thread
Get text with a specific color (user functions) from the QM code editor - by Davider - 04-05-2025, 08:07 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)