Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!ukc!edcastle!gtoal From: gtoal@castle.ed.ac.uk (G Toal) Newsgroups: comp.sys.acorn Subject: Re: Problem with procedures in BASIC Message-ID: <10808@castle.ed.ac.uk> Date: 4 Jun 91 21:54:59 GMT References: <7970@ecs.soton.ac.uk> Organization: Edinburgh University Lines: 22 In article <7970@ecs.soton.ac.uk> snb90@uk.ac.soton.ecs (Stewart Brodie) writes: :I have a small problem with a program I have written. It calls a :procedure to load the window templates into memory and then create the :windows so that the window handles are all set up correctly. However, :when run, the program returns 'Not in a procedure at line 1740' where :line 1740 is the ENDPROC statement. At first I thought that it was :probably caused by BASICs stack begin corrupted due to lack of memory, :so I increased the WimpSlot to 640K (The program only needs about 96K). :The problem persisted, so I ensured that the block into which the :templates were being loaded was large enough to hold the window with the :most icons. I made the block over the size of the template file, but :still the error comes. : The code goes roughly along these lines ... (I can't remember the :exact order of the SYS parameters, but they are right in my program.) : :DEF PROC_load_templates Look at the procedure/code *BEFORE* the line above - you may well have dropped down into it. Especially if what is before is the end of your main program... G