#!/usr/bin/tclsh # Example 1. # Using the basic clipboard procedures. # The output of running this script is in 'out1.txt'. source "lib_clip.tcl" cb_new tiger cb_new tail BEGIN cb_add tiger MAIN t "Hello, I am a tiger.\n" cb_add tiger MAIN p DATA cb_add tiger MAIN t "That's all.\n" cb_add tiger DATA t "My name is " cb_add tiger DATA p NAME cb_add tiger DATA t ".\n" cb_add tiger DATA r tail cb_add tiger DATA t "Those were my data.\n" cb_add tail BEGIN p BEGIN2 cb_add tail BEGIN2 p BEGIN3 cb_add tail BEGIN3 p BEGIN4 cb_add tail BEGIN4 p BEGIN5 cb_add tail BEGIN5 t "I have a " cb_add tail BEGIN5 p VERY cb_add tail BEGIN5 t "long tail.\n" foreach i {1 2 3 4 5} { cb_add tail VERY t "very " } cb_add tiger NAME t "growl" puts "---" cb_output tiger puts "" cb_output tail puts "---" cb_clear tiger NAME cb_add tiger NAME t "claw" cb_clear tail VERY cb_add tail VERY t "moderately " puts "---" cb_output tiger puts "" cb_output tail puts "---" cb_add tiger NAME t " junior" cb_clear tail BEGIN cb_add tail BEGIN t "My tail is longer than my dad's.\n" puts "---" cb_output tiger puts "" cb_output tail puts "---" cb_delete tiger cb_delete tail