[comp.sys.mac.programmer] Pascal Question...

hoffman@uxe.cso.uiuc.edu (05/18/88)

Does anybody know how to TRANSFER from one application directly
to another without going back to the Finder.  I need a solution that
will work in a high-level language (i.e. TML Pascal).  I already
know it can be done in machine code.

Steve Hoffman
hoffman@uxe.cso.uiuc.edu

leonardr@uxe.cso.uiuc.edu.UUCP (05/18/88)

Hoffman@uxe.cso.uiuc.eduedu:comp.sys.mac.programmer

>Does anybody know how to TRANSFER from one application directly
>to another without going back to the Finder.  I need a solution that
>will work in a high-level language (i.e. TML Pascal).  I already
>know it can be done in machine code.
>
	The first question is whether or not you want the code to sublaunch or not
and whether you want it to work  under MultiFinder....If you can answer these
questions, that it will be much easier to help you out...
	
+---------------------------------+-----------------------------------+
+                                 +  Any thing I say may be taken as  +
+   Leonard Rosenthol             +  fact, then again you might decide+
+   President, LazerWare, inc.    +  that it really isn't, so you     +
+                                 +  never know, do you??             +
+   leonardr@uxe.cso.uiuc.edu     +                                   +
+   GEnie:  MACgician             +                                   +
+   Delphi: MACgician             +                                   +
+                                 +                                   +
+---------------------------------+-----------------------------------+

tedj@hpcilzb.HP.COM (Ted Johnson) (05/19/88)

Here is the LSC version:

#include <WindowMgr.h>
#include <QuickDraw.h>
#include <MacTypes.h>
#include <EventMgr.h>
#include <StdFilePkg.h>
#include <MenuMgr.h>

SFReply	theReply;
SFTypeList myTypes;
Point	SFDialogOrigin;
OSErr ErrorCode

main()
{
	InitGraf(&thePort);
	InitFonts();
	InitWindows();
	InitMenus();
	TEInit();
	InitDialogs(0L);
	FlushEvents(everyEvent, 0);
	
	myTypes[0] = 'APPL';
	
	SetPt(&SFDialogOrigin, 80, 80);

	SFGetFile(SFDialogOrigin, "\p", 0L, 1, myTypes, 0L, &theReply);

	if (theReply.good == TRUE) {
		ErrorCode = SetVol(0L, theReply.vRefNum);
	
		Launch(0, &theReply.fName);
	}
}


-Ted