Data Access Worldwide Knowledge Base

Article ID 2038
Article Title INFO: Difference between Broadcast and Broadcast No_Stop Behavior
Article URL http://www.dataaccess.com/kbasepublic/kbprint.asp?ArticleID=2038
KBase Category VDF (GENERAL)
Date Created 09/14/2004
Last Edit Date 09/14/2004


Article Text
QUESTION:
I have a program where I need to fill 4 different List objects that are children of a Group object. I am using the Broadcast command to send Add_Item to the Group object, but only the first List object was completely filled. The other List objects had only the first item added.

I replaced the Broadcast Send with Broadcast No_Stop Send and now all the lists are getting filled.

Shouldn't Broadcast Send have done the same?


ANSWER:
The broadcast command works as expected.

The difference you see is because Add_Item returns a value at runtime level -- it will return the value of current_item -- and that value could be 0 or non-zero.

In your program, when using Broadcast without an option(i.e. Broadcast Send Add_Item Msg_None "{Value}"), the return value for the first Add_Item for all lists is 0. When the second Add_Item is executed, its return value will be 1 (because that is the current_item value now) and broadcast will stop at the first list. For the same reason, when you use "Broadcast No_Stop" you get the behavior you were expecting from Broadcast and all lists (ignoring the non-zero return value) will have all the items added.

In the Help, the description for "Broadcast No_Stop" is the following:

"...the No_Stop option allows a Broadcast Get command to continue broadcasting even after an object returns a non-zero value for a Get message."

It leads you to believe only Broadcast Get will return some value. However, a value can be returned at runtime level (even for Broadcast Send), affecting the behavior of Broadcast in the way explained above.


Contributed By:
Sonny Falk
Company: Data Access Worldwide
Web Site: http://www.dataaccess.com


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.