Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!hp4nl!charon!daan From: daan@cwi.nl (Daan Otten) Newsgroups: comp.databases Subject: Re: dbase IV "popup" while editing data with "read" command Summary: It is possible with the command "KEYBOARD" Message-ID: <3231@charon.cwi.nl> Date: 28 Mar 91 09:39:15 GMT Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 56 Originator: daan@zwaan.cwi.nl In <881@imec.UUCP> symons@imec.be (Jan Symons) writ >> I am writing a dbase IV application which uses the "@... get" >> and "read" commands for data entry. However I also want the >> possibility to fill in the edited field by taking data from a >> list of keywords (from another .dbf file) using the "on popup..." >> command. >> >> My problem is that I cannot transfer the choice of the popup >> (prompt()) to the variable being edited with the "read" command. >> ... >> ... Once I have written such a procedure to enter the country names in a easy way. As far as I can recall it is not possible to assign the value of a menu-bar to a variable used in a screen format directly. At least not when you want to see the result immediately. I solved the problem by using the dbase IV command KEYBOARD which simulates keyboard input. The next piece of code might give you an idea: ----------------- procedure input ... define popup countries from ..,.. to ..,.. prompt field countries.dbf on key label F7 do ret_item with varread() ... @ 1, 10 get naam @ 2, 10 get adres @ 3, 10 get country read ... procedure ret_item parameter varread && the name of the currently read variable in the form .... on key label F7 && deactivate the on key label do case case varread = "COUNTRY" activate popup countries if lastkey() <> 27 && when popup terminates with another key than escape keyboard chr(26)+chr(25)+rtrim(prompt())+chr(13) && I cannot recall why the chr(26) and chr(25). Try it out. endif endcase on key label F7 do ret_item with varread .... ----------------- I hope this helps. Daan Otten