checking RTF control for EMPTY ()

I have trouble checking programmatically that RTF.textRTF is empty. If it is visually empty to the viewer the function EMPTY (RTF.textRTF) returns .F. If I use an assignment m.memVar = RTF.textRTF I can print it out as a set of strings (about 3) of formatting characters. It is after the control was filled with some text and subsequently that text was deleted (manually) in the control window.

How can a test be done to verify that the control is empty

Thanks.




Answer this question

checking RTF control for EMPTY ()

  • sahina

    Thanks you, Dave. It makes sense. The encryption post should actually be retracted. After some tinkering that revealed a coding snafu the encryption works fine. The EMPTY () still does not work but what you've suggested will take care of it. This is what I use for encryption:

    SET CLASSLIB TO "_CRYPT" ADDITIVE

    THISFORM.AddObject ("cCryptod","_cryptapi")



  • Val P

    I would not recommend CryptoAPI nowadays as it has some inconveniences, especially when you use it across OS.

    You could try Craig 's FLL instead:

    http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,db662a8f-d47c-46c8-b0d2-a591c20d024b.aspx

    See http://fox.wikis.com/wc.dll Wiki~CryptoAPI  for details.


  • Radovici

    Alex,

    Would you share what kind of inconveniences it has I'm concerned because I'm using it:)


  • Rick Winter

    Thanks you very much.

  • -Terry_K-

    I do not know what Alex would say but my guess is that ASCII coding sequences might not match at different OS and if this is not taken into account this may present problem with encryption in case if you encoded something in one OS and attempt to decode it in another. Presumably the other function is more universal.

  • YoungEngineer

    use : EMPTY (RTF.text) instrad of EMPTY (RTF.textRTF)
    The Text propery Ignors the RTF Code

    What are you Using for Encrption

    Dave


  • Eric Martin

    The presence of additional formatting characters also creates another problem. If I want to encrypt the content of RTF.textRTF those characters get in the encryption and when the decryption is performed the result does not look like anything resembling the original text.

    Thanks.



  • checking RTF control for EMPTY ()