Author Topic: What is the difference between these two commands?  (Read 4323 times)

TheHumbleOne

  • Community Member
  • Posts: 43
  • Hero Points: 1
What is the difference between these two commands?
« on: October 24, 2011, 09:20:19 PM »
What is the difference between the following 2 commands:

last_macro
last_recorded_macro

As far as I can see, they are identical and do the same thing.

What I am trying to do is re-run the last macro that I ran (not recorded).  Is there a command that does that?

I am running SE15 on Windows XP.

Thanks!

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: What is the difference between these two commands?
« Reply #1 on: October 25, 2011, 12:03:52 AM »
'last_command' re-runs the last command invoked on SE commandline.
This is a slightly modified version.
Code: [Select]
/**
 * derived from gemacs.e<p>
 * last_command executes the last valid command that was run from the command line.<br>
 * This version CAN be run even from the command line, although it doesn't make much sense ...
 */
_command void hs2_execute_last_command () name_info(','VSARG2_READ_ONLY|VSARG2_TEXT_BOX|VSARG2_EDITORCTL)
{
   index := prev_index('','C');
   last_index(index,'C');

   // go back in retrieve buffer until a (valid) entry is found
   _str line="";
   do
   {
      _cmdline.retrieve_skip();
      _cmdline.get_command(line);
   } while ( pos ( 'last_command', stranslate(line,'_','-') ) );

   clear_message();
   command_put(line);
   command_execute();
   _str cmsg = get_message();
   message(cmsg " - '" line "' re-done." );
   // message(line " re-done" ((cmsg :== '') ? "." : " -> '" get_message() "'"));

   return;
}
Have fun, HS2
« Last Edit: October 25, 2011, 12:07:36 AM by hs2 »

TheHumbleOne

  • Community Member
  • Posts: 43
  • Hero Points: 1
Re: What is the difference between these two commands?
« Reply #2 on: October 25, 2011, 04:44:54 PM »
Thanks a lot.  For my purposes, last_command should do it.