Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!sri-unix!stores From: stores@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Beginning LSP question Message-ID: <27975@sri-unix.SRI.COM> Date: 23 Feb 89 22:39:10 GMT Reply-To: stores@sri-unix.ARPA (Matt Mora) Distribution: usa Organization: SRI International, Menlo Park, CA. Lines: 78 I am new to programming the mac in pascal and I am trying to write a pure code resource for a popupmenu for MS QuickBasic in LSP. I got the fuction to work put i don't know how to pass the result back to QBasic. i want to pass the menuitem selected back to basic in the variable result. They predefined some routines of communicating to pascal. Below is part of the code. type INT16 = Integer; { Shortcut definitions } . . . LIBARG = record case INTEGER of 0: ( Descr: SDRECPTR ); { Pointer to the string variable [004] } 1: ( Int: ^INT16 ); { Pointer to the integer variable [004] } 2: ( Sngle: ^SINGLE ); { Pointer to the single variable [004] } 3: ( Doble: ^DOUBLE ); { Pointer to the double variable [008] } 4: ( Long: ^INT32 ); { Pointer to the long variable [004] } end; LIBARGPTR = ^LIBARG; . . . { * CALL PopupFontMenu(top%,left%,item,result%) this is the call from QB} { *----------------------------------------------------------------------*} procedure MAIN; var tempflag, argtype: INT16; valptr, result: LIBARGPTR; theitem: longint; menu: MenuHandle; top, left, item,menuItem: integer; begin argtype := GetNextLibArg(valptr, tempflag); {his gets the ptr} top := IntegerArg; argtype := GetNextLibArg(valptr, tempflag); left := IntegerArg; argtype := GetNextLibArg(valptr, tempflag); item := IntegerArg; argtype := GetNextLibArg(Result, tempflag); menuItem := IntegerArg; menu := NewMenu(1000, 'temp'); AddResMenu(menu, 'FONT'); if Menu <> nil then begin InsertMenu(menu, -1); theitem := PopUpMenuSelect(menu, top, left, item); disposeMenu(menu); menuitem := Loword(theItem); . . . How do i put the value of menuitem into result? if anyone can help me thanks alot! matt mora SRI International