PopMenu and FileMenu and the Boxes Functions
Keywords: FileMenu PopMenu Boxes functions
Question:
You can find here the PopMenu.mnw I have executed choising the option " test " via the PopMenu Icon:*************************************************************************** ; PopMenu.mnw ;============================================================ ErrorMode(@OFF) wbdir=RegQueryValue(@REGMACHINE,"SOFTWARE\WilsonWindowWare\WinBatch\CurrentVersion") if wbdir==0 wbdir=RegQueryValue(@REGMACHINE,"SOFTWARE\Wilson WindowWare\WinBatch Compiler\CurrentVersion") endif ErrorMode(@CANCEL) if wbdir==0 Display(5,"Error","Registry entries missing. Re-install WinBatch") exit endif ;============================================================== ; Définition des constantes globales à tous les scripts: ; ----------------------------------------------------- MPRESSE_WBT = "D:\Mpresse_Appl\Shell" Call ( "%MPRESSE_WBT%\CFG_def_constantes.wbt" , "" ) ;============================================================== ; test ; Reprise d'un document produit automatiquement ;============================================================== Call("%MPRESSE_WBT%\Box Drawing Demo.wbt","") ***************************************************************************The script " Box Drawing Demo.wbt " contains functions like " BoxesUp ". It works well when I open it from the Explorer.Apparently when passing by a PopMenu, the functions like " BoxesUp " are unknown : I get a window with the next message :
*************************************************** Box title : ERROR 3052 Box message : BoxesUp(" 100,100,900,900 ",@NORMAL) Winbatch PopMenu 99K Version WIL :2.9kbu ***************************************************It's a problem for us because we have built our application on the popmenu concept.After several tests, I have noticed that it works when I replace " Call " by " RunWait " in PopMenu.mnw.
Except that no argument can be passed that way.
Is there any good solution allowing to execute such scripts (containing functions like "BoxesUp ") from a PopMenu with arguments.
Answer:
As you discovered, Popmenu and Filemenu do not support the Boxes functions.Sorry the documentation didn't state that clearly. We'll get that fixed in the docs. You can use the Message function, or build a dialog with the Dialog editor.
RunWait can pass arguments. RunWait("xxx.wbt","STUFF") will NOT pass the parameter stuff. See the limitations of the RunWait function. However, RunWait("winbatch.exe","xxx.wbt STUFF") will pass the parameter stuff.
Article ID: W14225Filename: Boxes Functions with FileMenu and Popmenu.txt