On several lines you use "inestr" instead of "linestr" On 8/22/05 9:30 PM, "Brian Heibert" <bheibert@...> wrote: > '~'A > ' Runtime : Rntm Appearance.Incl > ' CPU : Carbon > ' CALL Req'd : Off > '~'B > /* > TWM - The only OS X, FB GUI builder in the world (probably) > > <http://homepage.ntlworld.com/bernie.w/twmad.htm> > */ > > > begin enum 1 > _Window1Wnd > end enum > > begin enum 1 > _cEdit > end enum > > #define FMFontFamily as SInt16 > toolbox fn FMGetFontFamilyFromName(Str255 iName) = FMFontFamily > > local fn BuildWindow1Wnd > dim as Str255 s > dim as ControlFontStyleRec tfs > dim as WindowAttributes wa > dim as Rect r > '~'< > wa = _kWindowCloseBoxAttribute¬ > _kWindowCollapseBoxAttribute > //SetRect(r, 0, 0, 640, 480)// Optional FB auto-centre > SetRect(r, 61, 95, 694, 574)// w: 640 h: 480 > appearance window -_Window1Wnd,¬ > "HBASIC", @r,¬ > _kDocumentWindowClass, wa > def SetWindowBackground(_kThemeActiveDialogBackgroundBrush, _zTrue) > '~'< > SetRect(r, 0, 0, 617, 478) > s = "" > edit field _cEdit, s, @r, _framed_noDrawFocus, _leftJust > edit text #_cEdit, fn FMGetFontFamilyFromName("Lucida Grande"), 13 > > SetRect(r, 617, 0, 632, 479) > scroll button -_cEdit,0,0,0,0, @r, _scrollOther > > appearance window _Window1Wnd > end fn > > local fn Init > fn BuildWindow1Wnd > end fn > > FN init > > local fn setupMenus > menu 3,0,1, "Command" > menu 3,1,1, "/RRun..." > menu 3,2,1, "/KCompile..." > > end fn > > fn setupMenus > > local fn ParseEFLines( efID as long ) > dim as handle efH > dim as long i, numLines > dim as str255 lineStr > > efH = TeHandle( efID ) > numLines = efH..teNLines% > > for i = 1 to numLines > lineStr = edit$( efID, i ) > spacePosition = INSTR( 1, lineStr, " " ) > LONG IF spacePosition > 0 > keyword = LEFT$( lineStr, spacePosition - 1 ) > restOfLine = MID$( ineStr, spacePosition + 1 ) > XELSE > keyword = "" > restOfLine = "" > END IF > SELECT keyword > > CASE "BEEP" > BEEP > > CASE "PRINT" > PRINT restOfLine > > END SELECT > > NEXT i > > END FN > > > LOCAL FN HandleMenu > dim menuNum, menuItem > menuNum = menu( _menuID ) > menuItem = menu( _itemID ) > if menuNum = 3 and menuItem = 1 then fn parseEFLines(_cEdit) > > end fn > > FN HandleMenu > > ON MENU FN HandleMenu > > DO > handleevents > until gFBQuit