Facility Control

 View Only
  • 1.  Knowing you've reached the end of a MessageParser

    Posted 03-23-2020 21:31

    Hi

    I'm walking through a messageparser object that I know has a lot of UTF strings in, I just don't know how many.

    I'm currently using this code, relying on the error generated when I try and get a string that's not there.

    It works, but is there a method I could call that says I've reached the end of the messageparser?

    Thanks

    Simon

    do{
    folderName = messageParser.readUTF();
    ogscript.debug(folderName);
    folders.push(folderName);
    }while (folderName!=null);
    }
    catch(err)
    {
    }


  • 2.  RE: Knowing you've reached the end of a MessageParser

    Posted 03-24-2020 10:20

    Hi Simon,

    I'm not aware of another method, I've used similar code to parse files using ogscript.createFileInput which works well, for example :

    var parse = true;
    do {
    try{
    var str = fileInput.readLine();
    }catch( error ){
    parse = false;
    }
    } while ( parse == true);

    thanks

    Colin.

     


    #DashBoard


  • 3.  RE: Knowing you've reached the end of a MessageParser

    Posted 03-24-2020 10:35

    Thanks Colin

    I suppose as it's the most likely error, it is perfectly valid.

    Simon


    #DashBoard