New topic: 

Copying textfield to clipboard

<http://forums.realsoftware.com/viewtopic.php?t=37989>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        scolwell          Post subject: Copying textfield to 
clipboardPosted: Tue Mar 08, 2011 9:08 am                         
Joined: Tue Mar 08, 2011 9:03 am
Posts: 1                Hello,

I have written a piece that randomly generates a number and then copies that 
number to the clipboard.  It does this when the letter "n" is pressed.  

For some reason this code doesn't always copy the number to the clipboard.  The 
number is in the textfield "TextRandom".  Here's the entire code.  Any 
thoughts?  This is in the key down area.


  If Keyboard.AsynckeyDown(&h2D) then
  
  
  TrialCount = TrialCount + 1
  TextTrial.Text = Cstr(TrialCount)
  Listbox1.AddRow(trim(Texttrial.text))
  
  
  Dim r as New Random
  TextRandom.Text = str(r.InRange (0, 1))
  Listbox1.Cell(Listbox1.LastIndex,1) = trim(TextRandom.text)
  
  Dim c as New Clipboard
  c.text = (TextRandom.text)
  c.Close
  
  
  End if   
                             Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to