Results 1 to 3 of 3

Thread: Direct_input clipboard crashes when clipboard is empty

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Zeist, Netherlands
    Posts
    196

    Default Direct_input clipboard crashes when clipboard is empty

    Don't know if it's new for DF2023 but does not happen in DF19.1

    Code:
    Direct_Input "Clipboard:"
     If (not (SeqEof)) Readln sValue
    Close_Input
    Complete reproduction:
    Code:
        Object oButton1 is a Button
            Set Location to 23 5
            Set Label to 'ClipBoard'
        
            // fires when the button is clicked
            Procedure OnClick
                String sValue
                Direct_Output 'ClipBoard:'
                Write ''
                Close_Output
                Direct_Input 'ClipBoard:'
                If (not (SeqEof)) Readln sValue
                Close_Input
                Showln sValue
            End_Procedure
        
        End_Object



    does always crash the application when the clipboard is empty. Empty means really empty (not a single space, but completely empty).

    Correction readln svalue is needed to get the crash....

    Correction (again). It is not very simple to reproduce, because clearing the clipboard is not very easy. The above code does not clear the clipboard in Windows 11 (my test environment). If you are using Windows 11, hit "windows + V" and then clear the clipboard.

    Regards, IJmert
    Last edited by IJmert; 8-Aug-2023 at 08:12 AM.
    I you create laws that are only interpretable by computers you get ruled by a computer...!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •