Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!mcsun!ukc!acorn!RMokady From: RMokady@acorn.co.uk (Ran Mokady) Newsgroups: comp.sys.acorn Subject: Re: Answer: Problem with procedures in BASIC Message-ID: <7475@acorn.co.uk> Date: 7 Jun 91 20:08:02 GMT References: <8009@ecs.soton.ac.uk> Sender: rmokady@acorn.co.uk Distribution: comp Organization: Acorn Computers Ltd, Cambridge, England Lines: 54 In article <8009@ecs.soton.ac.uk> snb90@uk.ac.soton.ecs (Stewart Brodie) writes: >Thank you for all the comments, but I have found the problem and >corrected it. For those who are interested : > > The fault is that my window name was TOO SHORT!! In the PRM it states >that: > >"If you use wildcards .. there must be enough space to put the full name >of the template in memory" > The PRM says (Page 1238) Wimp_LoadTemplate (SWI &400DB) On Entry: R1 = Pointer to user buffer for template. R2 = Pointer to workspace for indirected icons. R3 = Pointer to end of workspace R4 = 256-byte font reference array (-1 for no fonts) R5 = Pointer to (wildcarded) name to match (must be 12 bytes word-aligned) =============================== R6 = position to search from (0 for first call) On Exit: R2 = Pointer to remaining workspace R6 = position of next entry (0 if no match found) The template is at R1 The font array is updated if fonts were used the string at R5 is overwritten by the actual name (so at least 12 bytes must be available there) ============================ ... You must be pointing to 12 bytes word aligned even if the longest template ===================== name in the file is only 4 characters. The Wimp uses this as a temporary area, and there is no guarantee that in future versions it will not be used for things other than template names. Ran. ----- "We're children, Needing other children And yet letting our grown up pride Hide all the need inside Acting more like children than children"