PDA

View Full Version : partial event string



<FNG>
February 18th, 2004, 09:42 AM
Hi,

Quick question about event strings...

I am going to be receiving an event string from the girder ievent handler in the form EVENTNAME_xyz, where xyz will be changing. Is there any way i can just look for the first, constant part, to compare to an event string and take the last 3 parts and use them in a script?

I have searched the forum and not come up with anything yet so heres hoping,

Thanks

Matt

miked
February 18th, 2004, 10:01 AM
I don't think this can be done in the way you want it to. What I'd recommend instead is separating out the EVENT as the actual event, and then have the changing "xyz" part be the payload, which you can easily reference as the variable [pld1] (maybe [pld2] -- you'll have to play around with this). You can then look at the value of this variable to cause different commands to be triggered in response to receiving the event EVENT.

<FNG>
February 18th, 2004, 10:03 AM
Thought that might be the case.

No problem, thanks for your time,

Matt

miked
February 18th, 2004, 10:12 AM
Your question actually helped me in a big way . . . . I was working on a project where I had a program send events like disc1, disc2, disc3, etc., all the way to 400, and I was resigned to having Girder commands for each of these events. Now I'm just going to have the prog send the event disc, and put the 1, 2, 3, etc., in a payload.