Important: The information in this document is obsolete and should not be used for new development.
PPCBrowser
Use thePPCBrowserfunction to display the program linking dialog box, which allows a user to select a port to communicate with.
FUNCTION PPCBrowser (prompt: Str255; applListLabel: Str255; defaultSpecified: Boolean; VAR theLocation: LocationNameRec; VAR thePortInfo: PortInfoRec; portFilter: PPCFilterProcPtr; theLocNBPType: Str32): OSErr;
prompt- A line of text that the
PPCBrowserfunction displays as a prompt in the program linking dialog box. If you specifyNILor an empty string is passed, the default prompt "Choose a program to link to:" is used.applListLabel- The title of the list of PPC ports. If you specify
NILor an empty string is passed, the default title "Programs" is used.defaultSpecified- A value that determines which port is initially selected in the program linking dialog box. If you specify
TRUE, you must provide information in the parameterstheLocationandthePortInfo. In this case, thePPCBrowserfunction tries to select the PPC port specified by the parameterstheLocationandthePortInfowhen the program linking dialog box first appears. If you specifyFALSE, thePPCBrowserfunction selects the first port in the list and you can leave the location name record and the port information record (in the parameterstheLocationandthePortInfo) uninitialized.theLocation- The port location. For information on this data structure, see "The Location Name Record" on page 11-50.
thePortInfo- The port name. For information on this data structure, see "The Port Information Record" on page 11-51.
portFilter- Determines how the list of PPC ports is filtered. If this parameter is
NIL, the names of all existing PPC ports are displayed. If this parameter isn'tNIL, it must be a pointer to a port filter function.theLocNBPType- The NBP type passed to
NBPLookupto generate the list of computers. If you specifyNILor an empty string is passed, the default, "PPCToolBox", is used.DESCRIPTION
ThePPCBrowserfunction builds the list of ports and then displays the program linking dialog box.If you set the
defaultSpecifiedparameter toTRUE, thePPCBrowserfunction tries to select the PPC port specified by the parameterstheLocationandthePortInfowhen the program linking dialog box first appears. ThelocationKindSelectorfield in the location name record must be set to theppcNoLocationconstant (which specifies the local computer) or theppcNBPLocationconstant (which specifies the NBP object and NBP zone). TheppcNBPTypeLocationconstant is not supported for matching. When matching the location, only the object string and the zone string of the entity name are used--the type string is ignored. When matching the port, the entire PPC port record (script, name, and port type) is used in the port information record. TheauthRequiredfield of the port information record is ignored.The parameter
theLocNBPTypeof thePPCBrowserfunction specifies the NBP type passed toNBPLookupto generate the list of computers. If you specifyNILor an empty string is passed, the default, "PPCToolBox", is used. Note that the current computer is always included in the list of computers (even if a location with the specified type does not exist for it). If the parametertheLocNBPTypecontains either of the NBP wildcard characters (= or \xE2), thePPCBrowserfunction returns aparamErrresult code.If the
PPCBrowserfunction returnsnoErr, the parameterstheLocationandthePortInfospecify the port chosen by the user. If thePPCBrowserfunction returns auserCanceledErrresult code, the user clicked the Cancel button, and no port was selected. If the function returns amemFullErrresult code, there was not enough memory to load thePPCBrowserpackage, and the dialog box did not appear.
- Note
- You must not call the
PPCBrowserfunction from an application that is running in the background, since this function displays a dialog box on the user's screen.![]()
RESULT CODES
noErr 0 No error paramErr -50 Illegal parameter memFullErr -108 Not enough memory to load PPCBrowserpackageuserCanceledErr -128 User decided not to conduct a session SEE ALSO
For an example of the use of thePPCBrowserfunction, see Listing 11-4 on page 11-26. For an example of the program linking dialog box, see
Figure 11-12 on page 11-22. For information on port filter functions,
see page 11-79.