CMAC Delay or synchronous processing

Product Compare Forums Multi-Edit Support CMAC Delay or synchronous processing

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2920
    jbrucka
    Participant

    I am nearly done with my first CMAC and now only have to position the cursor at the bottom of the file. I am using eof; However, this doesn’t seem to work because it seems like it is being executed before the prior command is completed (previouis command is to open the file in ME). Is there a command to insert a delay or to make the commands synchronous? I have even tried calling a .bat program with a dos delay of 4 seconds but the macro doesn’t seem to wait for the answer.
    str strFile = TranslateCmdLine(‘s:\e43958\mydelay.bat’, ”); // define script to delay for 4 seconds
    ShellExecute(0, "open", strFile, "", "", 1); // execute script to delay for x seconds

    Any direction would be appreciated.

    #9457
    Clay Martin
    Keymaster

    Hi,
    Could you post your cmac code. There are lots of ways to open a file and I need to see how you are doing it.
    Thanks,
    Clay

    #9458
    jbrucka
    Participant

    Sure, here it is. the last line is supposed to (I think) position me at the bottom of the file but I am always on the first line.
    thanks

    macro tunemerge()
    {
    str strFile = TranslateCmdLine(‘s:\e43958\tunemerge.bat’, ”);
    str TStr = ‘<LFN><FILE>.<EXT>’; //Note single quotes
    str strArgs = TranslateCmdline(TStr,file_name); //file_name is name of file in current window. TranslateCmdLine replaces <LFN><FILE> with file_name name, <EXT> with file_name extension (<LFN> means use long file name. Optional.)
    Rm( "SaveFile /NP=1/RLN=1" );

    Rm( "WinOP /T=1" );

    ShellExecute(0, "open", strFile, strArgs, "", 0); //append the statement and spool via the bat file
    make_message(‘Ran: ‘ + strFile + ‘ ‘ + strArgs); // display message at the bottom of screen
    ShellExecute(0, "open", strArgs, "", "", 0); //open the file

    str strFile = TranslateCmdLine(‘s:\e43958\mydelay.bat’, ”); // define script to delay for x seconds
    ShellExecute(0, "open", strFile, "", "", 1); // execute script to delay for x seconds

    eof; // go to the end of the file
    }

    #9461
    Clay Martin
    Keymaster

    Hi,
    It may be that the command is not finished. After you try ldfiles, followed by the EOF, if that does not work you may want to consider replacing shellexecute with execprog. The options are documented around line 11 of winexe.sh. This command provides the option to make ME wait until the other process has completed. If you search the Src directory under the install directory you will find lots of examples on how execprog is used.

    Hope this helps,
    Clay

    #9462
    jbrucka
    Participant

    I appreciate the help but I am unable to get it to compile. I apologize but I just don’t have the experience in this type of coding to get much further. I have included the code that I have tried below, would anyone be able to tell me what it is I am doing wrong?

    thanks

    macro mytest()
    {
    str strFile = TranslateCmdLine(‘s:\e43958\tunemerge.bat’, ”);
    execprog(strFile,"","","",_EP_Flags_ExeDos); //open the file

    }

    ERROR 1: Syntax Error: ‘EXECPROG’

    #9463
    Clay Martin
    Keymaster

    Hi,
    You need to tell the compiler where execprog is. Add this to the top of the .s file after the Macro file statement but before your functions.
    #include winexec.sh

    #9464
    jbrucka
    Participant

    That is what I needed, thanks. I still haven’t gotten all of the kinks worked out but you have helped me a great deal. thanks again!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.