Extracting Fields Off a String

Hello.
I created a GUI that communicates with Arduino via serial. The GUI allows an user to input 4 numeric fields, which are converted to string. I stored all converted values within a string and each field has been separated with an asterisk. I also put at the beginning and at the end of the string the charterers < and > to signal the start and beginning of the string
So, in my example the input fields are 13, 24, 56, and 790. The created variable is <135624*790>
I did a little arduino code to find out how to "extract" the original fields off the variable and I noticed I can display one character at the time separated by '_' , which is a big accomplishment.
So my questions are:
How do I determine the length of the created string?
How do I tell arduino that the first field starts with the character < and ends with it finds the *?
How do I tell arduino that all fields are separated by the character *?
HOw do i convert the extracted fields to numbers. Also, the first field might contain decimal point and I want to keep it.
Also, I want arduino to disconnect from GUI as soon as all variable are all set.
Is this a common way to handle more than one numeric variable when send it over a serial port.
I am not a pro on this matter. (even building GUI, which was my first one ever)
I try to find answers and what I see is buch of for/next loop to extract the fields.

Please help if you guys can. In the mean time I am reading the arduino reference to find some of the answers

Thanks a lot

<1_35_62_4*7_9_0>_

Will all the fields be numeric, always? Post your code in code tags, screen shot images are useless. If you would like some help, try to make it easy, nobody is going to re-key your code from a screen shot.

First of all, don't use Strings, as they will cause the Arduino to crash. Use character arrays (C-strings).

  1. Define the length of the string by zero terminating it upon input.

  2. Study Serial Input Basics for guidance, and how to recognize start and stop characters.

  3. use strtok() to separate out the fields, with '*' as a delimiter.

Mr. jremington. Thank you very much for your wise answer. I got it working!!

Great, but to help other people, please post your code using code tags ("</>") button.

// Example 5 - Receive with start- and end-markers combined with parsing

const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];        // temporary array for use when parsing

      // variables to hold the parsed data
char messageFromPC[numChars] = {0};
int integer01FromPC = 0;
int integer02FromPC = 0;
int integer03FromPC = 0;
float floatFromPC = 0.0;

boolean newData = false;

//============

void setup() {
    Serial.begin(9600);
    
}

//============

void loop() {
    recvWithStartEndMarkers();
    if (newData == true) {
        strcpy(tempChars, receivedChars);
            // this temporary copy is necessary to protect the original data
            //   because strtok() used in parseData() replaces the commas with \0
        parseData();
        showParsedData();
        newData = false;
    }
}

//============

void recvWithStartEndMarkers() {
    static boolean recvInProgress = false;
    static byte ndx = 0;
    char startMarker = '<';
    char endMarker = '>';
    char rc;

    while (Serial.available() > 0 && newData == false) {
        rc = Serial.read();

        if (recvInProgress == true) {
            if (rc != endMarker) {
                receivedChars[ndx] = rc;
                ndx++;
                if (ndx >= numChars) {
                    ndx = numChars - 1;
                }
            }
            else {
                receivedChars[ndx] = '\0'; // terminate the string
                recvInProgress = false;
                ndx = 0;
                newData = true;
            }
        }

        else if (rc == startMarker) {
            recvInProgress = true;
        }
    }
}

//============

void parseData() {      // split the data into its parts

    char * strtokIndx; // this is used by strtok() as an index

    strtokIndx = strtok(tempChars,"*");      // get the first part - the string
    //strcpy(messageFromPC, strtokIndx); // copy it to messageFromPC
     floatFromPC = atoi(strtokIndx); // copy it to messageFromPC
   
    strtokIndx = strtok(NULL, "*"); // this continues where the previous call left off
    integer01FromPC = atoi(strtokIndx);     // convert this part to an integer

    strtokIndx = strtok(NULL, "*");
    integer02FromPC = atoi(strtokIndx);     // convert this part to a float

    strtokIndx = strtok(NULL, "*");
    integer03FromPC = atoi(strtokIndx);     // convert this part to a float

}

//============

void showParsedData() {
    Serial.println("The Numbers Are: ");
    Serial.print("Float:--> ");    
    Serial.println(floatFromPC);
    Serial.print("Integer_01 ->> ");
    Serial.println(integer01FromPC);
    Serial.print("Integer_02 ->>> ");
    Serial.println(integer02FromPC);
     Serial.print("Integer_03 -->>>>");
    Serial.println(integer03FromPC);
}