Warning Message Displayed at Start

Hello Everyone,

I have finally begun writing some scripts for batch data analysis and fitting - thanks to the help of many people here!!

For one of the functions I have written, I would like for a warning message window to be displayed BEFORE prompting the user for parameters. So a simple dialog box with an OK button is what I need. I checked and tried DoAlert and Popup but could not put it up running.

Anyone with suggestions?

Many Thanks,
R.
It seems I resolved it! It appears that the problem was that I needed to declare the string parameter "prefix" before calling "DoAlert". It is not immediate to me the need for that, so it is likely there is something still wrong with what I have written and I may have just found a workaround, rather than a proper good solution. It was not compiling with the error of "parameter not declared".

Many thanks for comments and suggestions!
R.
Menu "Macros"
"Batch Line Fit", DoBatchLineFit()
End

Function DoBatchLineFit()
    String prefix
    DoAlert  /T="ATTENTION" 0, "Make sure your data has been converted to waveform"
    Variable Vstart
    Variable Vend
    // Prompt user for parameters for fit (waves prefix and fit range)
    Prompt prefix, "Enter the prefix of waves to analyze"
    Prompt Vstart, "Enter LEFT limit of fit range"
    Prompt Vend, "Enter RIGHT limit of fit range"
    DoPrompt "PARAMETERS FOR BATCH FITTING", prefix, Vstart, Vend
    //In case of aborting
    if (V_Flag)
        Abort "Exiting Analysis"
    endif
        //rest of code...
END
The String prefix declaration needs to appear before the Prompt prefix command. Earlier is okay, as you have it. But this also works (and keeps the declaration closer to the rest of the related code):

Menu "Macros"
    "Batch Line Fit", DoBatchLineFit()
End
 
Function DoBatchLineFit()
    DoAlert  /T="ATTENTION" 0, "Make sure your data has been converted to waveform"
    // Prompt user for parameters for fit (waves prefix and fit range)
    Variable Vstart
    Variable Vend
    String prefix
    Prompt prefix, "Enter the prefix of waves to analyze"
    Prompt Vstart, "Enter LEFT limit of fit range"
    Prompt Vend, "Enter RIGHT limit of fit range"
    DoPrompt "PARAMETERS FOR BATCH FITTING", prefix, Vstart, Vend
    //In case of aborting
    if (V_Flag)
        Abort "Exiting Analysis"
    endif
        //rest of code...
END

rhjpires wrote:
It seems I resolved it! It appears that the problem was that I needed to declare the string parameter "prefix" before calling "DoAlert". It is not immediate to me the need for that, so it is likely there is something still wrong with what I have written and I may have just found a workaround, rather than a proper good solution. It was not compiling with the error of "parameter not declared".


--Jim Prouty
Software Engineer, WaveMetrics, Inc.