A "run-only" option for the C7 IDE

After the latest beta (5225) release several developers asked for a Run button which would simply run the current project instead of building the application first. There is a Start without Debugger option (Ctrl-F5) but in fact this invokes an MSBuild task. Even if the EXE is already built MSBuild will verify that a recompile isn’t needed, and that can take some time on a big multi-DLL solution.

I decided to play around with the Tools menu to see if there was a way to produce a “run only” behavior, and I did find a solution. But SV has now said that a run only button will be in the next build, but in the event that you can’t wait for the next build of C7, here’s what you need to do to add your own “Run only” menu option.

It was Ben Dell who got me started on the Tools menu. He pointed out that it was possible to run customized MSBuild tasks that way. And if you can run an MSBuild task on a project, why not a task to run an EXE?

First, create a new Win32 EXE solution (not an APP - this will be a hand coded program) called, say, Launcher. Launcher.clw contains just this code:

                    PROGRAM

                    MAP
                    END

    CODE
    run(COMMAND())

Compile the code.

Next, in Tools | Options | Tools create a new external tool called something like “Run the current application”.

Set the command to your Launcher.exe

Set the arguments to "${TargetPath}" (the quotes take care of long file names, although they may not be necessary) and the working directory to ${ProjectDir}.

Now when you want to launch a program you just highlight it in the solution explorer and choose the “Run the current application” option from the Tools menu.

Posted: March 30 2009

Clarion Roadmap

Try the roadmap (beta)

Search ClarionMag

 

Advanced search

From the archives

Creating SQL From XML With XSLT

4/19/2007 12:00:00 AM

You've heard all about XML, and you're probably using it. But do you know about XSLT? Often thought of as a style sheet for XML files, XSLT is far more: it's really a template language for converting XML files into other formats. Bernie Grosperrin shows how to create SQL statements directly from XML files using the power of XSLT. Part 1 of 2.