Copying Text

  1. Create two textboxes, an inputfield and a checkbox on the Easy Access screen using the following code:
    textbox([2,1], [8,117], { "name":"z_copyfrom", "textfont":"Arial", "textheight":"12", "textweight":"5"});
    textbox([9,1], [15,117], { "name":"z_copyto", "textfont":"Arial", "textheight":"12", "textweight":"5"});
    inputfield([19,42],{"name":"z_line","size":2,"nolabel":true});
    text([19,45],"Enter line number for the text");

    The screen now appears as follows:



  2. Create a toolbar pushbutton on the Easy Access screen to initiate the copytext operation. The code is as follows:
    pushbutton([TOOLBAR], "Copy", {"process":text_copy});
  3. Create a function to perform the actual operation. The code is as follows:
    function text_copy() {
    	copytext({"totext":"z_copyto", "fromtext":"z_copyfrom"});
    }
  4. Add some text to the z_text textbox on the the screen.
  5. Click the Copy pushbutton to copy the text from one textbox to the other. The screen will now appear as follows:

Since no modifiers options such as append or appendline are used, the copytext comand will replace any content in the destination textbox. the full content of the z_text textbox will be copied to the z_totext textbox. The screeen will now appear as shown below: