TIP: Click on subject to list as thread! ANSI
echo: semware
to: All
from: `Dalton Spence`
date: 2003-01-26 14:01:38
subject: [TSEPro] Re: Overiding UI Menus

From: "Dalton Spence" 
@Date: Sat, 25 Jan 2003 22:31:38 -0500
@Sender: semware-owner{at}sawasdi.apana.org.au



Sent: Wednesday, January 22, 2003 9:24 PM
 Remember how all this started with suggestions that
> some of the UI procedures be made "public"? To do this with
the UI shell,

For those just tuning in, the UI shell is a .s/.ui file that "#include"s a
standard .ui source file.

> insert the following block of code immediately after the #include
> statements.
>
>
/**************************************************************************
>   Public Macros Block - Insert UI macros in public name procedure shells
>                         to be used in external macros.
>
**************************************************************************/
> public proc pmUIProcName()     // Public name of UI procedure
>     mUIProcName()
> end
>
> This would be called using
ExecMacro("MyUi","pmUIProcName") if the shell
is
> in the Autoload list, or with
ExecMacro(".ui","pmUIProcName") if the
shell
> was burned in.

Expanding on this, to return an integer value from a UI procedure with
constant parameters the following format could be used:

public proc pmUIProc()
    string cmdline[MAXSTRINGLEN]=Query(MacroCmdLine)
    integer nP1 = Val(GetFileToken(cmdline,1))
    string sP2[MAXSTRINGLEN] = GetFileToken(cmdline,2)
    SetGlobalInt("nReturnValue", mUIProc(nP1, sP2))
end

The calling macro might have the following code:

    ExecMacro(".ui "+ Str(nP1) + ' "' + sP2 + '"',
"pmUIProc")
    integer nRtnVal=GetGlobalInt("nReturnValue")

This could easily be adjusted to return string values as well. (Thanks,
Sammy, for the info on where the command line was put.)

--
              {at}=================================================={at}
              | Dalton S. Spence, B.Sc.  |
              | Home Page: http://www.hwcn.org/~ag775/home.html  |
              |      Family Motto: Virtute Acquiritur Honos      |
              |   Perry Mason takes my white bowling ball and    |
              |   retreats from the World Trade Center. FNORD!   |
              {at}=================================================={at}


--
TSEPro mailing list



---
[sawasdi.apana.org.au] (3:800/846.13)
* Origin: apana>>>>>fidonet
SEEN-BY: 633/267 270
@PATH: 800/846 1 640/954 774/605 123/500 106/1 379/1 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.