Loading ...
Sorry, an error occurred while loading the content.

since SetScriptCopy is non-blocking ....

Expand Messages
  • Larry
    Hey Everyone, I need some help. I m using SetScriptCopy and after a lot of trial-and-error, I ve learned that SetScriptCopy is not blocking. I need to be able
    Message 1 of 4 , Oct 20, 2010
    • 0 Attachment
      Hey Everyone,

      I need some help. I'm using SetScriptCopy and after a lot of trial-and-error, I've learned that SetScriptCopy is not blocking.

      I need to be able to call SetScriptCopy and not leave the function until the script is finished (ie, I need to block further execution of my code until SetScriptCopy is done.

      And after looking in FCW32.TXT that is fairly obvious. :-)

      Mainly because there exists two other commands:
      1 - SetScriptsDone
      2 - AskScript

      Would it be better so use the callback function (SetScriptsDone) or go into a tight loop checking (AskScript) after the call to SetScriptCopy?

      The reason I ask (as everyone knows, I'm not an expert at C/C++) is that callbacks are not my strong point.

      How would you use SetScriptsDone in a blocking manner?
      How would I use AskScript in a blocking manner?

      If anyone has examples and the Glue rountines to call them, thanks!

      L. Lee Saunders
    • Larry
      OK this is what I ve tried ... to no avail: ExecScriptCopy(cmd); while(AskScript() != 0) { Sleep(500); } &&&& int _stdcall _AskScript() { int s; __asm mov s,
      Message 2 of 4 , Oct 20, 2010
      • 0 Attachment
        OK this is what I've tried ... to no avail:

        ExecScriptCopy(cmd);

        while(AskScript() != 0)
        {
        Sleep(500);
        }

        &&&&

        int _stdcall _AskScript()
        {
        int s;
        __asm mov s, eax;
        return s;
        }

        With a:

        #define AskScript _AskScript

        I really want to get past this issue, so please help!!!!!

        Lee

        --- In cc2-dev-l@yahoogroups.com, "Larry" <saunderl@...> wrote:
        >
        > Hey Everyone,
        >
        > I need some help. I'm using SetScriptCopy and after a lot of trial-and-error, I've learned that SetScriptCopy is not blocking.
        >
        > I need to be able to call SetScriptCopy and not leave the function until the script is finished (ie, I need to block further execution of my code until SetScriptCopy is done.
        >
        > And after looking in FCW32.TXT that is fairly obvious. :-)
        >
        > Mainly because there exists two other commands:
        > 1 - SetScriptsDone
        > 2 - AskScript
        >
        > Would it be better so use the callback function (SetScriptsDone) or go into a tight loop checking (AskScript) after the call to SetScriptCopy?
        >
        > The reason I ask (as everyone knows, I'm not an expert at C/C++) is that callbacks are not my strong point.
        >
        > How would you use SetScriptsDone in a blocking manner?
        > How would I use AskScript in a blocking manner?
        >
        > If anyone has examples and the Glue rountines to call them, thanks!
        >
        > L. Lee Saunders
        >
      • Peter Olsson
        The ExecScriptCopy will put a command into the macro queue. The next command in the macro queue (might not be yours) will be executed **after** your command
        Message 3 of 4 , Oct 21, 2010
        • 0 Attachment

          The ExecScriptCopy will put a command into the macro queue. The next command in the macro queue (might not be yours) will be executed *after* your command returns to the command line. The only way to do this is therefore:

           

          1.     Call AbortAllScripts() to make sure the macro queue is empty

          2.     Call ExecScriptCopy() with the macro to execute and your command name to return to the XP

          3.     Call CmdEnd() to terminate your command

          4.     Detect that you are reentering your command after the macro has been executed.

           

          The alternative is to use MYCMD and then return to MYCMD2 (but then you have to manually update the repeat command).

           

          Do you really need to call a macro command?

           

          Peter

           

          From: cc2-dev-l@yahoogroups.com [mailto:cc2-dev-l@yahoogroups.com] On Behalf Of Larry
          Sent: Thursday, October 21, 2010 12:12 AM
          To: cc2-dev-l@yahoogroups.com
          Subject: [cc2-dev-l] Re: since SetScriptCopy is non-blocking ....

           

           

          OK this is what I've tried ... to no avail:

          ExecScriptCopy(cmd);

          while(AskScript() != 0)
          {
          Sleep(500);
          }

          &&&&

          int _stdcall _AskScript()
          {
          int s;
          __asm mov s, eax;
          return s;
          }

          With a:

          #define AskScript _AskScript

          I really want to get past this issue, so please help!!!!!

          Lee

          --- In cc2-dev-l@yahoogroups.com, "Larry" <saunderl@...> wrote:

          >
          > Hey Everyone,
          >
          > I need some help. I'm using SetScriptCopy and after a lot of
          trial-and-error, I've learned that SetScriptCopy is not blocking.
          >
          > I need to be able to call SetScriptCopy and not leave the function until
          the script is finished (ie, I need to block further execution of my code until SetScriptCopy is done.
          >
          > And after looking in FCW32.TXT that is fairly obvious. :-)
          >
          > Mainly because there exists two other commands:
          > 1 - SetScriptsDone
          > 2 - AskScript
          >
          > Would it be better so use the callback function (SetScriptsDone) or go
          into a tight loop checking (AskScript) after the call to SetScriptCopy?
          >
          > The reason I ask (as everyone knows, I'm not an expert at C/C++) is that
          callbacks are not my strong point.
          >
          > How would you use SetScriptsDone in a blocking manner?
          > How would I use AskScript in a blocking manner?
          >
          > If anyone has examples and the Glue rountines to call them, thanks!
          >
          > L. Lee Saunders
          >

        • L. Lee Saunders
          Yes, I project does require calling macro commands. And, my command cannot be reentrant, so .. What exactly is MCMD & MYCMD2? I cannot find references to them
          Message 4 of 4 , Oct 21, 2010
          • 0 Attachment

            Yes, I project does require calling macro commands.

             

            And, my command cannot be reentrant, so ….

             

            What exactly is MCMD & MYCMD2?  I cannot find references to them in FCW32.TXT or any of the .h files.

             

            Lee

             

            From: cc2-dev-l@yahoogroups.com [mailto:cc2-dev-l@yahoogroups.com] On Behalf Of Peter Olsson
            Sent: Thursday, October 21, 2010 9:28 AM
            To: cc2-dev-l@yahoogroups.com
            Subject: RE: [cc2-dev-l] Re: since SetScriptCopy is non-blocking ....

             

             

            The ExecScriptCopy will put a command into the macro queue. The next command in the macro queue (might not be yours) will be executed *after* your command returns to the command line. The only way to do this is therefore:

             

            1.     Call AbortAllScripts() to make sure the macro queue is empty

            2.     Call ExecScriptCopy() with the macro to execute and your command name to return to the XP

            3.     Call CmdEnd() to terminate your command

            4.     Detect that you are reentering your command after the macro has been executed.

             

            The alternative is to use MYCMD and then return to MYCMD2 (but then you have to manually update the repeat command).

             

            Do you really need to call a macro command?

             

            Peter

             

            From: cc2-dev-l@yahoogroups.com [mailto:cc2-dev-l@yahoogroups.com] On Behalf Of Larry
            Sent: Thursday, October 21, 2010 12:12 AM
            To: cc2-dev-l@yahoogroups.com
            Subject: [cc2-dev-l] Re: since SetScriptCopy is non-blocking ....

             

             

            OK this is what I've tried ... to no avail:

            ExecScriptCopy(cmd);

            while(AskScript() != 0)
            {
            Sleep(500);
            }

            &&&&

            int _stdcall _AskScript()
            {
            int s;
            __asm mov s, eax;
            return s;
            }

            With a:

            #define AskScript _AskScript

            I really want to get past this issue, so please help!!!!!

            Lee

            --- In cc2-dev-l@yahoogroups.com, "Larry" <saunderl@...> wrote:

            >
            > Hey Everyone,
            >
            > I need some help. I'm using SetScriptCopy and after a lot of
            trial-and-error, I've learned that SetScriptCopy is not blocking.
            >
            > I need to be able to call SetScriptCopy and not leave the function until
            the script is finished (ie, I need to block further execution of my code until SetScriptCopy is done.
            >
            > And after looking in FCW32.TXT that is fairly obvious. :-)
            >
            > Mainly because there exists two other commands:
            > 1 - SetScriptsDone
            > 2 - AskScript
            >
            > Would it be better so use the callback function (SetScriptsDone) or go
            into a tight loop checking (AskScript) after the call to SetScriptCopy?
            >
            > The reason I ask (as everyone knows, I'm not an expert at C/C++) is that
            callbacks are not my strong point.
            >
            > How would you use SetScriptsDone in a blocking manner?
            > How would I use AskScript in a blocking manner?
            >
            > If anyone has examples and the Glue rountines to call them, thanks!
            >
            > L. Lee Saunders
            >

          Your message has been successfully submitted and would be delivered to recipients shortly.