Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sun Nov 19, 2017 8:54 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: calling a function
PostPosted: Wed Sep 07, 2011 8:08 pm 
Offline

Joined: Thu Aug 09, 2007 4:44 pm
Posts: 67
This might be a basic question that I just missed in reading the documentation, but is it possible to execute the code with a function of an object from within the code of another object... without actually invoking the conditions for that function to be executed? For example, I have some code that executes within the valueChanged function of OBJECT1. I have another object (OBJECT2) which changes the OBJECT1.value and I expect the appropriate code to be executed. Sometimes the new value is equal to the old value, but I would still like the code within the valueChanged function to be executed as if the value had been changed. Possible?

Thanks


Top
 Profile  
 
 Post subject: Re: calling a function
PostPosted: Thu Sep 08, 2011 7:24 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
This might be a bit easier, if I knew which object type we were discussing. If the ValueChanged event doesn't fire when the value property is reassigned its current value, you could work around it like this:

Code:
func SetValue(newValue as float)
    if obj2.value == newValue then
        obj2.ValueChanged()
    else
        obj2.value = newValue
    endif
endfunc

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group