Microsoft KB Archive/74236

{| = Use the KEYS Function to Send an Array of Data to Q+E =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q74236

SUMMARY
The KEYS function allows you to send keystrokes to Q+E using DDE (dynamic data exchange). You might want to use KEYS instead of the POKE command in situations where you want to concatenate data from various locations into a string and send it to Q+E.

MORE INFORMATION
In addition to numbers and text, you can send the following keystrokes:

TAB, LEFT ARROW, RIGHT ARROW, UP ARROW, and DOWN ARROW The following examples enter a new Last_Name, First_Name, and Employee_Number in the first record in EMP.DBF. Line 1 starts Q+E and open the sample file EMP.DBF, which is placed in the QE subdirectory when you install Q+E. You may need to modify the path in cell A1 to point to the correct location of EMP.DBF in your system. Line 2 turns on Allow Editing. Line 3 selects cell R1C1 in Q+E. Line 4 places the text &quot;Tami&quot; in cell R1C1, tabs to cell R1C2, and enters &quot;Sanders,&quot; then tabs to cell R1C3 and enters &quot;E56987.&quot;

Example 1
A1  chan=INITIATE(&quot;qe&quot;,&quot;select * from dbasefile|c:\excel\qe\emp.dbf&quot;) A2  =EXECUTE(chan,&quot;[allow.edit(TRUE)]&quot;) A3  =EXECUTE(chan,&quot;[select.area('R1C1')]&quot;) A4  =EXECUTE(chan,&quot;[keys('Tami{tab}Sanders{tab}E56987')]&quot;) A5  =TERMINATE(chan) A6  =RETURN

Example 2
A1 chan=INITIATE(&quot;qe&quot;,&quot;select * from dbasefile|d:\excel\qe\emp.dbf&quot;) A2 =EXECUTE(chan,&quot;[allow.edit(TRUE)]&quot;) A3 =EXECUTE(chan,&quot;[select.area('R1C1')]&quot;) A4 =EXECUTE(chan,&quot;[keys('&quot;&A8&&quot;{tab}&quot;&A9&&quot;{tab}&quot;&A10&&quot;')]&quot;) A5 =TERMINATE(chan) A6 =RETURN A7  A8  Tami A9 Sanders A10 E56987 Note: In line A4 of the second example, both the first and last text strings that are being concatenated together contain a single quotation mark. The first string is read as: &quot;double quotation mark&quot;, &quot;open square bracket&quot;, &quot;k&quot;, &quot;e&quot;, &quot;y&quot;, &quot;s&quot;, &quot;open parenthesis&quot;, &quot;single quotation mark&quot;, &quot;double quotation mark&quot;