Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Neue Zeile ($N) in String suchen

WBB
2012-05-29
2012-05-30
  • WBB - 2012-05-29

    Hallo Users,

    derzeit lese ich aus einem Gerät einen String aus, der mit $N getrennt ist, wie: 'ABCD$NDEF$NGHI'.
    $N stellt immer eine neue Zeile dar.

    Mit welcher Funktion kann ich diese Stelle suchen? Möchte nur den Stringteil bis zum ersten $N verwenden,
    allerdings ist die Anzahl der Buchstaben davor nie konstant, weiß daher die Anzahl nicht.

    Vielen Dank für Hilfe und Tips.

    Gruß Wolle

     
  • r.freund - 2012-05-29

    Stringfunktionen (standard.lib): FIND

    Gruß

     
  • WBB - 2012-05-29

    Danke, aber funktioniert so nicht.

    Hab ich schon getestet.

     
  • r.freund - 2012-05-29

    FIND('abcde$Nfgh', '$N') liefert bei mir das Resultat 5 (zumindest in der Simulation).

    Gruß

    Edit: auch wenn mehrere $N vorkommen.

     
  • WBB - 2012-05-30

    DANKE!

    Hab es nochmals getestet. Jetzt geht es , warum auch immer.

     

Log in to post a comment.