[Tcladdressbook-commits] Help TclAB_QuickStart.aida,1.6,1.7
Status: Alpha
Brought to you by:
bdesgraupes
|
From: Bernard D. <bde...@us...> - 2004-07-29 13:31:45
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5493/Help Modified Files: TclAB_QuickStart.aida Log Message: New 1.1b1 commands Index: TclAB_QuickStart.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.aida,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- TclAB_QuickStart.aida 26 Jan 2004 23:07:07 -0000 1.6 +++ TclAB_QuickStart.aida 29 Jul 2004 13:31:36 -0000 1.7 @@ -6,7 +6,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-12-14 18:26:47 -:Modified: 2004-01-23 22:03:14 +:Modified: 2004-07-29 01:35:42 :Keywords: Address book, data base @@ -86,6 +86,11 @@ The value of ((i myrecord i)) is a keyed list. One can use the usual Tcl list commands to parse this value or special commands defined in the TclX extension (see section ((rf ukl ))Using keyed lists rf)) below). +((nl The ((i getme i)) command can also be used with an ((i -id i)) option. +In that case the unique ID of the "Me" record is returned: +((| + set myID [addressbook getme -id] +|)) ((s2 The [record] subcommand @@ -99,7 +104,6 @@ set person [addressbook record $theid] |)) - Similarly with a group: store the ID of the first group in the variable ((i theid i)) ((| set theid [lindex [addressbook groups -ids] 0] @@ -118,7 +122,7 @@ |)) -((s2 The [remove] subcommand +((s2 The [delete] subcommand Remove from the database the record corresponding to the ID ((i $theid i)) ((| addressbook delete $theid @@ -132,13 +136,25 @@ addressbook save |)) + +((s2 The [add] subcommand +Add to a specific group the record corresponding to the ID ((i $theid i)): +this can be a person as well as a group (which would then become a +subgroup of the group to which it is added). +((| + set groupid [lindex [addressbook groups -ids] 0] + set theid [lindex [addressbook persons -ids] 0] + addressbook add $theid $groupid +|)) + + +((s2 The [remove] subcommand Remove from a specific group the record corresponding to the ID ((i $theid i)): -it is removed as member of this subgroup but will be removed from the -database only if it does not belong to other groups. +this can be a person as well as a group. ((| set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] - addressbook delete $theid -fromgroup $groupid + addressbook remove $theid $groupid |)) @@ -155,6 +171,7 @@ One can also find the parents of a group using this command. + ((s2 The [create] subcommand One can create either a group's or a person's record. The third argument will be the "name" of the new record, that is to say the name of the new @@ -190,6 +207,7 @@ For the two examples above, the result is respectively ((i String i)) and ((i MultiDictionary i)). + ((s2 The [property add] subcommand Add a new person's property called ((i Instrument i)) with type ((i String i)) ((| @@ -201,7 +219,20 @@ addressbook property add -groups Meeting Date |)) + ((s2 The [property remove] subcommand +The third argument of this command can be either a record ID or the +-persons and -groups keywords. If it is the former, the property is removed +from the specified record, otherwise it is removed from all the records of +this type and the return value is now the number of properties successfully +removed. +((| + set theid [addressbook getme -id] + addressbook set $theid MaidenName Violet + addressbook save + addressbook property remove $theid MaidenName +|)) + Remove the properties created above: ((| addressbook property remove -persons Instrument @@ -239,6 +270,7 @@ The data returned is binary. You can store it in a file for instance. An error is raised if there is no custom image for this record. + ((s2 The [set] subcommand This command lets you get or set the value of a particular field. For instance, to get the first name, dates and address fields of the first record: |