Sending parameter from my edited text file to command line

Sending parameter from my edited text file to command line

1
NewbieNewbie
1

    Apr 09, 2008#1

    Hi, do you know how to make "dynamic" command line parameters ?

    In UEStudio I have one text file witch contain my variable on second line. For example :

    Code: Select all

    REM this is my text file (created by myself 1.1.1900 :o)
    var = 456
    some text ...
    bla bla ...
    I need to run the external compiler with User Tool. If I use the command line:

    Code: Select all

    C:\My Folder\MyCompiler.exe -456
    where "456" is my variable - my compiler works fine.

    How can I do it "automatic" ?

    Some like :

    Code: Select all

    C:\My Folder\MyCompiler.exe -%2nd_line_variable_next_to_"var = "_string%
    Do you understand me ? (sry 4 my English ...)

    6,606548
    Grand MasterGrand Master
    6,606548

      Apr 10, 2008#2

      Should be no problem. Change in the user tool the command line to:

      C:\My Folder\MyCompiler.exe -%sel%

      Now when you run the tool %sel% in the command line is replaced by the currently selected text in the active window.

      To automatically select the variable value, you can use a macro or a script to select it and then run the user tool. Here is the macro solution:

      UnixReOff
      Top
      Find RegExp "var ++= ++"
      Key RIGHT ARROW
      SelectWord
      RunTool "case-sensitive name of your user tool"

      You can assign a hotkey to the macro for fast execution. The macro must be saved into a macro file which is specified to be automatically loaded on startup of UEStudio.

      Note: You can also use Find "var = " if the variable is specified surely always exactly as specified here.

      Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.

      Or you use a script with a hotkey with the same commands in JavaScript language.
      Advantage of a script solution: You don't need to automatically load the script on startup of UES.
      Disadvantage of the script solution: If the output of the user tool is captured to the output window, you maybe get troubles because the JavaScript engine writes normally also to the output window. Of course you maybe could avoid the output handling problem with the appropriate JavaScript command(s) to disable writing status informations during script execution to the output window. I have never tested till now running a tool from within a script, so I don't have experience for this situation.
      Best regards from an UC/UE/UES for Windows user from Austria