B4A Library Clipboard Library

Libor

Member
Licensed User
Longtime User
Hi how does one use this library, I mean I know to put it in additional library directory but beyond that in terms of in code.

thanks
 

Libor

Member
Licensed User
Longtime User
Got it. I've just found that app it's super. I've been cutting and pasting into a word document as I find info so that I can locate it quickly later.

This makes life a little ... lot easier.

Just one comment. It would be useful if one could add their own comments. Potentially could be shared or just for your self.

Sometimes especially since I'm new to programing I give myself an explanation in a way that I'll remember the functionality better. It would be good if I could attach that comment and also search it.

thanks for the pointer :sign0161:
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Just one comment. It would be useful if one could add their own comments. Potentially could be shared or just for your self.

Sometimes especially since I'm new to programing I give myself an explanation in a way that I'll remember the functionality better. It would be good if I could attach that comment and also search it.
Interesting idea. Thanks.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Yeah, it needed documentation. I had to read the XML file...
B4X:
         dim something as BClipboard

to copy

B4X:
         something.clrText 
         something.settext(TextToCopy)

to paste

B4X:
         something.getText

to check if there is text in the clipboard

B4X:
         something.hasText
 

warwound

Expert
Licensed User
Longtime User
My xml2bb script shows very little reference for this library:

Version: 0
  • BClipboard
    Methods:
    • clrText
    • getText As String
    • hasText As Boolean
    • setText (text As String)

Martin.
 
Last edited:

artsoft

Active Member
Licensed User
Longtime User
Hi together,

i ask me, how big (megabytes) a text may be to set it in the Clipboard or to get it from the Clipboard.
I know there are limits based on the physical size of the device.

I tested with this code:

B4X:
    Dim s As String
 
    s = ""
 
    For i = 1 To 1024
 
        s = s & "1"
 
    Next
 
    ' ................... 1 kb
 
    Dim t As String
 
    For i = 1 To 1024
 
        t = t & s
 
    Next
 
    ' ................... 1 MB
 
    Dim u As String
 
    For i = 1 To 5
 
        u = u & t
 
    Next
 
    ' ..................... 5 MB
 
    Dim c As BClipboard
 
    c.setText(u)
 
    ' ....................... Scheint zu klappen!

    Dim x As String
 
    x = c.getText
 
    Dim k As Int
 
    k = x.Length
 
    Msgbox ("Größe: " & k, "Hm...")

The MsgBox shows a value of 5553.
But this is not a size of 5 Megabytes.

Who can helps here? - Thx all in advance.

Best regards
ARTsoft
 

Flavio SOuza

Member
Licensed User
Longtime User
BTW, you should use StringBuilder instead of string when you concatenate many strings.

On the device I tested it, it failed to set the text when it was larger than 1mb. I don't think that the limit is documented anywhere.


This lib still works for the SDK 26+. On Android 32 and 64bits?
 
Top