New message

Purpose: Create new message.

 new-message <message> [ from <string> ]

new-message will create a new <message> object.

If <string> is specified (in "from" clause), then it is used to create a <message> from it. The <string> must be in SEMI format, which may be in request's input, from get-message, from reading a file etc; in this case <message> can only be read from with read-message.

If new-message is used without "from" clause, data can be added to <message> with write-message.
Examples
 begin-handler /msg public
     new-message msg
     write-message msg key "weather" value "nice"
     write-message msg key "distance" value "near"
     start-loop
         read-message msg key k value v status s
         if-true s not-equal GG_OKAY
             break-loop
         end-if
         @Key is <<p-out k>> and value is <<p-out v>>
     end-loop
 end-handler

See also
Messages
get-message  
new-message  
read-message  
SEMI  
write-message  
See all
documentation


Copyright (c) 2019-2024 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.