directIn's... is this possible? 
Author Message
 directIn's... is this possible?

I would like to know if there's any way to get "directIn's": to get an
event out from an owned node directly into a function without using
routes and without "looking at" the event out field of that node. I
suspect the problem with the bit of code following is the confusion
betwen an events itself and the *field* of that event. How much do I'm
right?

In the code below, the "start()" function start the time sensor and (
with some faith..) that time sensor deliver its events into the
"setOne()" function arguments.

DEF TestScript Script {
  eventIn SFTime start
  eventIn SFTime stop
  eventIn SFTime setOne
  field   SFNode time TimeSensor { cycleInterval .5 loop TRUE }
  directOutput  TRUE  
  url   "javascript:      
    function start(t, time) {
      time.startTime = t;
      setOne(time.cycleTime);   // This do not work - any
    }                           // other way around?
    function stop(t, time) {
      time.stopTime = t;
    }
    function setOne(t, time) {
      //some action here...
    }
  "

Quote:
}



Mon, 28 May 2001 03:00:00 GMT  
 directIn's... is this possible?

Quote:

> DEF TestScript Script {
>   eventIn SFTime start
>   eventIn SFTime stop
>   eventIn SFTime setOne
>   field      SFNode time TimeSensor { cycleInterval .5 loop TRUE }
>   directOutput     TRUE  
>   url      "javascript:      
>     function start(t, time) {

This time shadows the SFNode time, I'm afraid.

Quote:
>       time.startTime = t;
>       setOne(time.cycleTime);      // This do not work - any
>     }                           // other way around?

setOne requires a value and a timestamp.

Quote:
>     function stop(t, time) {
>       time.stopTime = t;
>     }
>     function setOne(t, time) {
>       //some action here...
>     }
>   "
> }

I only give the function start as I would write it. As I always make
mistakes, it is not supposed to work, but it might do something.

function start(t, et) { //t is the time, et is the time the event was sent
  time.startTime = t;
  setOne(time.cycleTime, et);

Quote:
}

Hope this does something goodx,
        Marijn

--
-------------------------------------------------------------
 April 15 1998: fys.ruu.nl -> phys.uu.nl
-------------------------------------------------------------
 Commercial and/or unsollicited email and/or spam will be
 processed for a DFL100 handling fee. Unsolicited sending
 constitutes acceptance.  
-------------------------------------------------------------



Tue, 29 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I am thinking of if this is possible

2. 'who am i' from unix

3. Possible 'Parse Arg' problem

4. Possible 'catch' bug

5. Possible bug in 'scrolledtext'?

6. I am not deaf, but am I mute?

7. I can't believe I am learning Clipper

8. Where am I wrong?(this has to be wrong, it can't be so simple)

9. Fixed point math in asm -HELP ME I 'am dying here

10. Just the facts ma'am (Re: Link on _TRUTH_)

11. Is too many dll's possible??

12. It's POSSIBLE IN CLIPPER

 

 
Powered by phpBB® Forum Software