Joe_Carrick

Insert Macro in Custom Macros

Recommended Posts

I've just been playing with this X10 feature.  It's pretty awesome, allowing a composite macro to be easily created from existing global, object, & user macros.  

 

I LOVE IT !!!!

Share this post


Link to post
Share on other sites

It would be even more awesome if we could use text formatting on each line - Rich Text ;)

Share this post


Link to post
Share on other sites

Are you referring to:

 

To include a Ruby macro within another Ruby macro, use this format: macros.macro_name.

Share this post


Link to post
Share on other sites

What I would like to know is, what new features will that give us.

Share this post


Link to post
Share on other sites

Just open TMM and start a new non-evaluated macro.  Then select any existing macro(s) from the < button with additional text or <enter> as needed.

Share this post


Link to post
Share on other sites
On 2018-05-24 at 8:40 AM, Joe_Carrick said:

I've just been playing with this X10 feature.  It's pretty awesome, allowing a composite macro to be easily created from existing global, object, & user macros.  

 

I LOVE IT !!!!

 

I just tried creating a composite macro, but all my user macros are greyed out. I can only use Chief's OOB macros. Are you saying it's different for you?

Share this post


Link to post
Share on other sites

user macros are only "greyed out" if they are not currently considered valid.  If you use error handling constructs in your macros you can essential guarantee that they will always be valid.  IOW:

 

  • begin
  •   result = some code that might fail
  • rescue
  •   result = code that never fails
  • end
  • Upvote 1

Share this post


Link to post
Share on other sites
3 minutes ago, LevisL said:

 

I just tried creating a composite macro, but all my user macros are greyed out. I can only use Chief's OOB macros. Are you saying it's different for you?

 

You have to use the macros.name format, and if it's an evaluated macro, the Insert> won't work anyway. 

Share this post


Link to post
Share on other sites

Michael,

See my answer above.  I use this principle in almost all my macros for just this reason.

Share this post


Link to post
Share on other sites

I'm not sure we're all even talking about the same thing here so I'll take a moment to clarify.

 

Imagine we have 2 evaluated macros:

Macro #1:

Name:  macro_1

Context: none

Value:  1+2

 

Macro #2:

Name:  macro_2

Context: none

Value:  2*3

 

 

We have the Insert> button in TMM that has actually been there for quite some time now.  Using that button you can insert both macros into a new non-evaluated macro as dumb text like this:

 

%macro_1% + %macro_2%

 

The result would be 3 + 6

 

 

 

What's new in X10 however is that you could also use an evaluated  macro and enter the macros like this:

 

macros.macro_1 + macros.macro_2

 

The result would be 9

 

Share this post


Link to post
Share on other sites

I understand but I don't think that was Levis's problem. 

 

IAE, I will probably never need the 2nd form that was made possible in X10 since there are other ways of accomplishing those results - which I am very comfortable with using.  Both "rb" files and custom class methods are capable of providing the same functionality and are IMO more consistent with Ruby standards.

Share this post


Link to post
Share on other sites

I got it working now. Thanks guys!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Member Statistics

    28292
    Total Members
    6254
    Most Online
    DJRobinson13
    Newest Member
    DJRobinson13
    Joined