Posted to tcl by centrix at Thu May 18 19:17:27 GMT 2017view raw

  1. proc set_entry e {
  2. set x [list $e]
  3. puts [lindex e 1]
  4. set ::fromlangexpr [lindex $x 2]
  5. .notes insert end [lindex $x 0]
  6. .notes insert end [lindex $x 4]
  7. }
  8.  
  9. proc pick_entry { mlng } {
  10. set entryid [expr {int(rand()*[llength $::entries])}]
  11. set entryindex [lsearch -exact $::entries $entryid]
  12. set ::entries [lreplace $::entries $entryindex $entryindex]
  13. set x [dbif GetLessonEntry $mlng $entryid]
  14. if { [dbif GetLastError] != "" } {
  15. show_err "DB error: [dbif GetLastError]"
  16. return
  17. }
  18. puts ">>> [lindex $x 2]"
  19. puts ">>> [llength $x]"
  20. set_entry $x
  21. }
  22.  
  23.  
  24.  
  25. >>> mandag
  26. >>> 6
  27.