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

Stringlänge Ermitteln

strempfl
2016-07-18
2016-07-29
  • strempfl - 2016-07-18

    Obwohl die Bibliothek StringUtils mit der Funktion LEN eingebunden ist
    lässt sich die Funktion LEN nicht übersetzen.

    PROGRAM Fhandle
    VAR
    fwrite:BOOL:=FALSE;
    fread:BOOL:=FALSE;
    fdel:BOOL:=FALSE;
    hndl:DWORD;
    erg:RTS_IEC_RESULT;
    text:STRING:='Eine Zeile';
    END_VAR

    IF fwrite THEN
    hndl:=sysfileopen('/mnt/ramdisk/test.txt',ACCESS_MODE.AM_WRITE,erg);
    sysfilewrite(hndl,ADR(text),LEN(text),erg);
    sysfileclose(hndl);
    fwrite:=FALSE;
    END_IF;

     
  • wollvieh

    wollvieh - 2016-07-29

    hallo,

    ich verwende immer SIZEOF(text) ...

     

Log in to post a comment.