unset.n
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:2k
源码类别:

通讯编程

开发平台:

Visual C++

  1. '"
  2. '" Copyright (c) 1993 The Regents of the University of California.
  3. '" Copyright (c) 1994-1996 Sun Microsystems, Inc.
  4. '" Copyright (c) 2000 Ajuba Solutions.
  5. '"
  6. '" See the file "license.terms" for information on usage and redistribution
  7. '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  8. '" 
  9. '" RCS: @(#) $Id: unset.n,v 1.5.18.2 2004/10/27 14:43:15 dkf Exp $
  10. '" 
  11. .so man.macros
  12. .TH unset n 8.4 Tcl "Tcl Built-In Commands"
  13. .BS
  14. '" Note:  do not modify the .SH NAME line immediately below!
  15. .SH NAME
  16. unset - Delete variables
  17. .SH SYNOPSIS
  18. fBunset fR?fI-nocomplainfR? ?fI--fR? ?fIname name name ...fR?
  19. .BE
  20. .SH DESCRIPTION
  21. .PP
  22. This command removes one or more variables.
  23. Each fInamefR is a variable name, specified in any of the
  24. ways acceptable to the fBsetfR command.
  25. If a fInamefR refers to an element of an array then that
  26. element is removed without affecting the rest of the array.
  27. If a fInamefR consists of an array name with no parenthesized
  28. index, then the entire array is deleted.
  29. The fBunsetfR command returns an empty string as result.
  30. .VS 8.4
  31. If fI-nocomplainfR is specified as the first argument, any possible
  32. errors are suppressed.  The option may not be abbreviated, in order to
  33. disambiguate it from possible variable names.  The option fI--fR
  34. indicates the end of the options, and should be used if you wish to
  35. remove a variable with the same name as any of the options.
  36. .VE 8.4
  37. If an error occurs, any variables after the named one causing the error not
  38. deleted.  An error can occur when the named variable doesn't exist, or the
  39. name refers to an array element but the variable is a scalar, or the name
  40. refers to a variable in a non-existent namespace.
  41. .SH EXAMPLE
  42. Create an array containing a mapping from some numbers to their
  43. squares and remove the array elements for non-prime numbers:
  44. .CS
  45. array set squares {
  46.     1 1    6 36
  47.     2 4    7 49
  48.     3 9    8 64
  49.     4 16   9 81
  50.     5 25  10 100
  51. }
  52. puts "The squares are:"
  53. parray squares
  54. fBunsetfR squares(1) squares(4) squares(6)
  55. fBunsetfR squares(8) squares(9) squares(10)
  56. puts "The prime squares are:"
  57. parray squares
  58. .CE
  59. .SH "SEE ALSO"
  60. set(n), trace(n), upvar(n)
  61. .SH KEYWORDS
  62. remove, variable