Path: utzoo!mnetor!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.os.vms Subject: TPU: Key-name question Message-ID: <2571@enea.se> Date: 31 Dec 87 22:18:49 GMT Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.os.vms Organization: ENEA DATA Svenska AB, Sweden Lines: 30 I have a TPU procedure where I read a key and executes it unless it's a printable character which I insert into the buffer. Unfortunately the following does not work: Key := Read_key; Function := Lookup_key(Key, PROGRAM); IF Function <> 0 THEN Execute(Function) ENDIF; Thus, Lookup_key does not return Self_insert for an undefined printable character. So I do: ch := 32; LOOP EXITIF (Key_name(ch) = Key) OR (ch > 127); ch := ch + 1; ENDLOOP And one more loop for 8-bit characters. This isn't very efficient, and on an unloaded 750 you do notice the delay. Thus, I'd like to find a more efficient way. Is there anyone who has done this or has an idea? I'd assume one could deduce it more directly from the key name. -- Erland Sommarskog ENEA Data, Stockholm sommar@enea.UUCP C, it's a 3rd class language, you can tell by the name.