Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!uunet!mcsun!ukc!icdoc!sot-ecs!snb90 From: snb90@uk.ac.soton.ecs (Stewart Brodie) Newsgroups: comp.sys.acorn Subject: Re: Answer: Problem with procedures in BASIC Message-ID: <8070@ecs.soton.ac.uk> Date: 10 Jun 91 10:37:09 GMT References: <8009@ecs.soton.ac.uk> <7475@acorn.co.uk> Sender: news@ecs.soton.ac.uk Distribution: comp Lines: 62 Organisation: University of Southampton Originator: snb90@gloriana In <7475@acorn.co.uk> RMokady@acorn.co.uk (Ran Mokady) writes: >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" Sorry, I was quoting from memory and I've never had this kind of problem before. Must be just lucky. Stewart