user52317: Having in my visual basic app something like:
private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
        *whatever* value = serialPort1.Read*whatever*();
    }

Suppose my Arduino sends in every loop, the value read by a photoresistor. Suppose my Arduino also sends a 0 if certain led is LOW or a 1 if certain led is HIGH. Finally suppose my Arduino also sends a value that is equal to the number of times the loop has been executed.
In the 25th execution, lets suppose my Arduino sends something like:
Serial.write(LED_state) // 0 or 1 for LOW or HIGH
Serial.write(photoresistor_value) //lets suppose 25
Serial.write(loop_number) //25 

Question: if all the values are sent using Serial.write or Serial.print, and all values are ints, how can I distinguish in my app if the value 25 received belongs to the photoresistor or to the loop? Is there any way to send something like (key, value) from Arduino so I can distinguish between the ints received so I can assign them correctly to my app variables?

user7508: 
Is there any way to send something like (key, value)

Sure:
Serial.print("LED state: ");
Serial.println(LED_state);

You will have to modify your VB code to parse that.

52317: <p>Having in my visual basic app something like:</p>

<pre><code>private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
        *whatever* value = serialPort1.Read*whatever*();
    }
</code></pre>

<p>Suppose my Arduino sends in every loop, the value read by a photoresistor. Suppose my Arduino also sends a 0 if certain led is LOW or a 1 if certain led is HIGH. Finally suppose my Arduino also sends a value that is equal to the number of times the loop has been executed.</p>

<p>In the 25th execution, lets suppose my Arduino sends something like:</p>

<pre><code>Serial.write(LED_state) // 0 or 1 for LOW or HIGH
Serial.write(photoresistor_value) //lets suppose 25
Serial.write(loop_number) //25 
</code></pre>

<p>Question: if all the values are sent using Serial.write or Serial.print, and all values are ints, how can I distinguish in my app if the value 25 received belongs to the photoresistor or to the loop? Is there any way to send something like (key, value) from Arduino so I can distinguish between the ints received so I can assign them correctly to my app variables?</p>
 7508: <blockquote>
  <p>Is there any way to send something like (key, value)</p>
</blockquote>

<p>Sure:</p>

<pre><code>Serial.print("LED state: ");
Serial.println(LED_state);
</code></pre>

<p>You will have to modify your VB code to parse that.</p>
