Microsoft KB Archive/45894

= EDIT$ Returns &quot;Invalid Function Call&quot; in Nonactive Window =

Article ID: 45894

Article Last Modified on 11/21/2006



This article was previously published under Q45894



SUMMARY
The EDIT$ function gives an &quot;Invalid Function Call&quot; (error 5) in Microsoft QuickBASIC Version 1.00 for the Apple Macintosh when trying to retrieve the contents of an EDIT FIELD that is not in the active window.



MORE INFORMATION
The EDIT$ function can be used to return the current contents of an edit field only within the active window. You must first make the EDIT FIELD's window active before invoking EDIT$. The syntax is as follows, where fieldnumber is the number of the field that was previously defined with an EDIT FIELD statement:

EDIT$(fieldnumber)

The above statement returns the user's input for a specific field.

If you open a window, define EDIT FIELDs, receive input into these fields, change your active window, and try to retrieve the information in the previous EDIT FIELDs, you generate an &quot;Invalid Function Call&quot; (error 5).

For more information on the EDIT$ function and the EDIT FIELD statement, consult the &quot;Microsoft QuickBASIC for Apple Macintosh: User's Guide,&quot; Pages 113-117.

Code Example
WINDOW 1, &quot;Current EDIT Window&quot;,(50,50)-(320,160),1 EDIT FIELD 1,&quot;&quot;,(5,10)-(250,100),1 WHILE MOUSE(0) = 0 : WEND names$ = EDIT$(1) WINDOW 2, &quot;This is NOW the CURRENT window&quot;,(100,200)-(370,300),1 ' This next line will generate an &quot;Invalid Function Call&quot; names$ = EDIT$(1) PRINT names$ WHILE MOUSE(0) = 0 : WEND END

Additional query words: MQuickB

Keywords: KB45894

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.