Home AMX User Forum NetLinx Studio

DPS to CHAR Array?

Greetings,

I am working on a system where various client systems send requests to a server system.

I am trying to find a way to convert the DPS of the sending virtual device from its device definition to a character array to include as text in the command being sent so that the server would know where to send the response back to.

Does anyone know of some embedded function that creates such arrays?

For example:

In the client module:
SEND_STRING vdvServer,"'This Message Came From ',<DEV string>"

Where the server module would see:
This Message Came From 33000:1:100
and would be able to send a message back to the client.

Thanks.

Comments

  • viningvining Posts: 4,368
    DEFINE_FUNCTION CHAR[11]fnDEV_TO_STRING(DEV iDEVICE)//
         
         {
         RETURN "itoa(iDEVICE.NUMBER),':',itoa(iDEVICE.PORT),':',itoa(iDEVICE.SYSTEM)" ;
         }
    
    
    
    //some where in the code!
    
    SEND_STRING vdvServer,"'This Message Came From ',fnDEV_TO_STRING(dvSomeDevice)" ;
    

    On the other side you can do the opposite function fnSTRING_TO_DEV if needed.
  • TurnipTruckTurnipTruck Posts: 1,485
    You're like Circuit City... Just What I Needed!

    Thanks dude!
Sign In or Register to comment.