Cicode Genie

hello,

i am trying to make a Cicode genie for a IF function.

so far this is the cicode i have:

FUNCTION KmrBzttngRichTextFileOpen()

IF +bsKmrNrRTF=1

THEN

DspDel (+AnNr)

+bsKmrNrRTF=0

ELSE

PageRichTextFile (+sAnNr, "D:\CtKamerBezetting\"+sAfdlngRTF+"\"+sKmrNr+".rtf", 2, 200, 275);

+bsKmrNrRTF=1;

End

End

so far most of it i got to work, both the path and the AnNr work.

how ever i cant get the "bsKmrNrRTF" to work.

the idea is that when i press on a grapical genie i put in a variable tag that has to be put in place of the "bsKmrNrRTF".

BsKmrNrRTF is at the moment a LOCAL INT adres.

but has to be replace with a Variable adres that gets its value from the PLC.

i wonder if there is a way to make this work? and what i could do to sort this?

thanks in advance.

Arriën

Parents
  • hey Eric,
    sorry for the long silence,
    i managed to get it to work how i wanted.
    ----------------------------------------------------------------------------------------------
    STRING msCurrentFile = "";
    .

    FUNCTION RtfOpen(STRING sAfdlingRTF, STRING sKmrNr, INT hAN)


    IF msCurrentFile <> "" AND NOT DisplayKmrNr

    THEN
    DspRichTextSave(hAN, msCurrentFile)
    DspDel(hAN);
    msCurrentFile="";

    ELSE
    IF msCurrentFile <> "" AND DisplayKmrNr

    THEN
    DspDel(hAN)
    msCurrentFile = "";

    ELSE
    msCurrentFile = "D:\CtKamerBezetting\"+sAfdlingRTF+"\"+ sKmrNr+".rtf";
    PageRichTextFile(hAN, msCurrentFile, 2, 200, 275);


    END
    END


    END
    ----------------------------------------------------------

    this is what it ended up looking like.

    thank you for all the help and advice you have given me,

    Arriën Duinkerken
Reply
  • hey Eric,
    sorry for the long silence,
    i managed to get it to work how i wanted.
    ----------------------------------------------------------------------------------------------
    STRING msCurrentFile = "";
    .

    FUNCTION RtfOpen(STRING sAfdlingRTF, STRING sKmrNr, INT hAN)


    IF msCurrentFile <> "" AND NOT DisplayKmrNr

    THEN
    DspRichTextSave(hAN, msCurrentFile)
    DspDel(hAN);
    msCurrentFile="";

    ELSE
    IF msCurrentFile <> "" AND DisplayKmrNr

    THEN
    DspDel(hAN)
    msCurrentFile = "";

    ELSE
    msCurrentFile = "D:\CtKamerBezetting\"+sAfdlingRTF+"\"+ sKmrNr+".rtf";
    PageRichTextFile(hAN, msCurrentFile, 2, 200, 275);


    END
    END


    END
    ----------------------------------------------------------

    this is what it ended up looking like.

    thank you for all the help and advice you have given me,

    Arriën Duinkerken
Children
No Data