Recent

Author Topic: Got "TTranslateString", expected "TPersistent"  (Read 1900 times)

mrmaxmusterman

  • New Member
  • *
  • Posts: 18
Got "TTranslateString", expected "TPersistent"
« on: July 13, 2021, 10:33:04 pm »
Im currently creating an aes en-/decryption program in lazarus. So far, everything is working fine. The only problem i currently have is that i want to copy the output to clipboard. I therefore used the function:

Code: Pascal  [Select][+][-]
  1. Clipboard.Assign(Edit.Text)

Note: Under the uses section, "Clipbrd" is set in place

When tryping to compile, i'll get the following error:

"aes_unit.pas(80,40) Error: Incompatible type for arg no. 1: Got "TTranslateString", expected "TPersistent""

Is there any way that i can convert the translatestring to a normal string etc. so that i can therefore copy it to my clipboard?

Bart

  • Hero Member
  • *****
  • Posts: 5661
    • Bart en Mariska's Webstek
Re: Got "TTranslateString", expected "TPersistent"
« Reply #1 on: July 13, 2021, 11:03:37 pm »
Try:
Code: Pascal  [Select][+][-]
  1.   ClipBoard.AsText := Edit1.Text;

Bart

mrmaxmusterman

  • New Member
  • *
  • Posts: 18
Re: Got "TTranslateString", expected "TPersistent"
« Reply #2 on: July 13, 2021, 11:09:02 pm »
It works. Thank you so much!

 

TinyPortal © 2005-2018