WWPoke()
- Last UpdatedJul 22, 2024
- 2 minute read
Using the DDE protocol, pokes a value to a specified application, topic, and item and returns the status.
Category
WWDDE
Syntax
Status = WWPoke( Application, Topic, Item, TextValue );
Parameters
Application
The application to which you want to send the Poke command. Actual string or a string attribute.
Topic
The topic within the application. Actual string or a string attribute.
Item
The item to poke within the topic. Actual string or a string attribute.
TextValue
The value to poke. If the value you want to send is a number, you can convert it using the Text(), StringFromIntg(), or StringFromReal() functions. Actual string or a string attribute.
Return value
Status is an Integer attribute to which 1, -1, or 0 is written. The WWPoke() function returns 1 if the application is running, the topic and item exist, and the value was sent successfully. It returns 0 if the application is busy, and -1 if there is an error.
Remarks
Note: The three WWDDE functions Execute(), Poke() and Request() exist for legacy purposes.
The value TextValue is sent to the particular application, topic, and item specified.
Important: The following applies to using WWRequest() in synchronous scripts:
1. Never loop them (call them over and over).
2. Never call several of them in a row and in the same script.
3. Never use them to call a lengthy task in another DDE application. All three actions,
though, are appropriate in asynchronous scripts.
Example
The following statement converts a value to text and pokes the result to an Excel spreadsheet cell:
String=Text(Value,"0");
WWPoke("excel","[Book1.xls]sheet1","r1c1",String);
The behavior for WWPoke() from within the application "View" to "View" is undefined and is not supported. The WWPoke() command is not guaranteed to succeed in this instance, and the command will probably time-out without the desired results.