A forum for Spin users
You are not logged in.
Pages: 1
I want to send a string between 2 processes. Please any one help me for this. I am not getting how to send a bulk of character at a time between processes.
Offline
a String is not a basic data type in Promela, so I'm afraid that you cannot do this.
You could of course send a byte array, for instance by definiting a data structure with a typedef that holds the byte array:
typedef String { byte word[32]; };
and then declare an instance of that type:
String mystring;
Now you can fill in the characters in the word and send the String over a channel:
chan c = [2] of { String };
c!mystring;
etc. (but this is of course not really a convenient way to do things).
Better is to use mtype declaration for fixed terms, that otherwise you'd use a string for:
mtype = { Apple, Pear, Hello_World };
mtype mystring = Hello_World;
and then use the mtype in the channel and for communications.
Offline
Thanks for yous reply sir.........
Offline
Pages: 1