[Tcladdressbook-commits] Help TclAB_QuickStart.html,1.5,1.6
Status: Alpha
Brought to you by:
bdesgraupes
|
From: <bde...@pr...> - 2004-01-26 23:08:37
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19322/Help Modified Files: TclAB_QuickStart.html Log Message: Update for 1.0b1 release Index: TclAB_QuickStart.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TclAB_QuickStart.html 6 Jan 2004 06:58:32 -0000 1.5 +++ TclAB_QuickStart.html 26 Jan 2004 23:07:23 -0000 1.6 @@ -4,51 +4,46 @@ <META NAME=GENERATOR CONTENT="Aida Mode"> </HEAD> <BODY> - -<!-- :Title: TclAB_QuickStart --> -<!-- :Project: addressbook extension for Tcl --> -<!-- :Version: $Revision$ --> -<!-- :CVSDate: $Date$ --> -<!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> -<!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --> -<!-- :Created: 2003-12-14 18:26:47 --> -<!-- :Modified: 2004-01-04 21:10:51 --> -<!-- :Keywords: Address book, data base --> -<!-- :TclCmd: set currentversion [package require addressbook] --><P><!-- logo --> +<P><!-- logo --> <P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P> -<P> <A href="TclAB.html">Home Page</A> | <A href="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> +<P> <A HREF="TclAB.html">Home Page</A> | <A HREF="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> This file is a tutorial that demonstrates the [addressbook] command defined by the Tcladdressbook extension for Tcl. It documents -version 1.0b1. -For a detailed and complete description of the syntax of each subcommand, -refer to the <A href="TclAddressBookHelp.html">help file</A>. +version 1.0b1. All the Tcl instructions in the sections +below are very short one-line commands which you can try in any Tcl shell, +like tclsh for instance. +<P> For a detailed and complete description of the syntax of each subcommand, +refer to the <A HREF="TclAddressBookHelp.html">help file</A>. +The home page for Tcladdressbook is +<A HREF="http://tcladdressbook.sourceforge.net/"> on the SourceForge site</A>. </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">Using the commands</A> -<UL><LI><A HREF="#M2">The [groups] command</A></UL> -<UL><LI><A HREF="#M3">The [persons] command</A></UL> -<UL><LI><A HREF="#M4">The [count] command</A></UL> -<UL><LI><A HREF="#M5">The [getme] command</A></UL> -<UL><LI><A HREF="#M6">The [record] command</A></UL> -<UL><LI><A HREF="#M7">The [type] command</A></UL> -<UL><LI><A HREF="#M8">The [remove] command</A></UL> -<UL><LI><A HREF="#M9">The [parents] command</A></UL> -<UL><LI><A HREF="#M10">The [create] command</A></UL> -<UL><LI><A HREF="#M11">The [property names] command</A></UL> -<UL><LI><A HREF="#M12">The [property type] command</A></UL> -<UL><LI><A HREF="#M13">The [property add] command</A></UL> -<UL><LI><A HREF="#M14">The [property remove] command</A></UL> -<UL><LI><A HREF="#M15">The [export] command</A></UL> -<UL><LI><A HREF="#M16">The [import] command</A></UL> -<UL><LI><A HREF="#M17">The [image] command</A></UL> -<UL><LI><A HREF="#M18">The [set] command</A></UL> -<UL><LI><A HREF="#M19">The [search] command</A></UL> +<UL><LI><A HREF="#M2">The [groups] subcommand</A></UL> +<UL><LI><A HREF="#M3">The [persons] subcommand</A></UL> +<UL><LI><A HREF="#M4">The [count] subcommand</A></UL> +<UL><LI><A HREF="#M5">The [getme] subcommand</A></UL> +<UL><LI><A HREF="#M6">The [record] subcommand</A></UL> +<UL><LI><A HREF="#M7">The [type] subcommand</A></UL> +<UL><LI><A HREF="#M8">The [remove] subcommand</A></UL> +<UL><LI><A HREF="#M9">The [parents] subcommand</A></UL> +<UL><LI><A HREF="#M10">The [create] subcommand</A></UL> +<UL><LI><A HREF="#M11">The [property names] subcommand</A></UL> +<UL><LI><A HREF="#M12">The [property type] subcommand</A></UL> +<UL><LI><A HREF="#M13">The [property add] subcommand</A></UL> +<UL><LI><A HREF="#M14">The [property remove] subcommand</A></UL> +<UL><LI><A HREF="#M15">The [export] subcommand</A></UL> +<UL><LI><A HREF="#M16">The [import] subcommand</A></UL> +<UL><LI><A HREF="#M17">The [image] subcommand</A></UL> +<UL><LI><A HREF="#M18">The [set] subcommand</A></UL> +<UL><LI><A HREF="#M19">The [search] subcommand</A></UL> <LI><A HREF="#M20">Using keyed lists</A> -</UL><P>Load the extension +</UL> +First load the extension like this <PRE> package require addressbook -</PRE><P><H2><A NAME="M1"></A> Using the commands</H2> -<H3><A NAME="M2"></A> The [groups] command</H3> +</PRE><P><H2><A NAME="M1"></A>Using the commands</H2> +<H3><A NAME="M2"></A>The [groups] subcommand</H3> List all the groups (ID and name) <PRE> addressbook groups @@ -65,7 +60,7 @@ List the subgroups of a specific group (only ID) <PRE> addressbook groups -ids -ingroup $groupid -</PRE><P><H3><A NAME="M3"></A> The [persons] command</H3> +</PRE><P><H3><A NAME="M3"></A>The [persons] subcommand</H3> List all the persons records (ID and name) <PRE> addressbook persons @@ -73,26 +68,26 @@ List all the persons records (only ID) <PRE> addressbook persons -ids -</PRE><P><H3><A NAME="M4"></A> The [count] command</H3> +</PRE><P><H3><A NAME="M4"></A>The [count] subcommand</H3> Count the existing groups and persons records <PRE> addressbook count -groups addressbook count -persons addressbook count -persons -ingroup [lindex [addressbook groups -ids] 0] -</PRE><P><H3><A NAME="M5"></A> The [getme] command</H3> +</PRE><P><H3><A NAME="M5"></A>The [getme] subcommand</H3> Store the info about "me" in the variable <I>myrecord</I>. <PRE> set myrecord [addressbook getme] </PRE> 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 <A href="#ukl">Using keyed lists</A> below).<P><H3><A NAME="M6"></A> The [record] command</H3> +extension (see section <A HREF="#ukl">Using keyed lists</A> below).<P><H3><A NAME="M6"></A>The [record] subcommand</H3> Store the ID of the first record in the variable <I>theid</I> <PRE> set theid [lindex [addressbook persons -ids] 0] </PRE> Store the info about this record in the variable <I>person</I>. The -returned value has the same keyed list format as with the [getme] command. +returned value has the same keyed list format as with the [getme] subcommand. <PRE> set person [addressbook record $theid] </PRE><P>Similarly with a group: store the ID of the first group in the variable <I>theid</I> @@ -102,12 +97,12 @@ Store the info about this group in the variable <I>grp</I> <PRE> set grp [addressbook record $theid] -</PRE><P><H3><A NAME="M7"></A> The [type] command</H3> +</PRE><P><H3><A NAME="M7"></A>The [type] subcommand</H3> Find the type (<I>ABPerson</I> or <I>ABGroup</I>) of the object corresponding to the ID <I>$theid</I> <PRE> addressbook type $theid -</PRE><P><H3><A NAME="M8"></A> The [remove] command</H3> +</PRE><P><H3><A NAME="M8"></A>The [remove] subcommand</H3> Remove from the database the record corresponding to the ID <I>$theid</I> <PRE> addressbook delete $theid @@ -126,7 +121,7 @@ set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] addressbook delete $theid -fromgroup $groupid -</PRE><P><H3><A NAME="M9"></A> The [parents] command</H3> +</PRE><P><H3><A NAME="M9"></A>The [parents] subcommand</H3> List the parents of a person record (the various groups it belongs to). <PRE> set theid [lindex [addressbook persons -ids] 0] @@ -135,7 +130,7 @@ List the parents of a person record (only ID) <PRE> addressbook parents -ids $theid -</PRE><P>One can also find the parents of a group using this command.<P><H3><A NAME="M10"></A> The [create] command</H3> +</PRE><P>One can also find the parents of a group using this command.<P><H3><A NAME="M10"></A>The [create] subcommand</H3> 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 group or the last name of the new person respectively. The command returns @@ -150,37 +145,37 @@ set grpid [lindex [addressbook groups -ids] 0] set subgrpid [addressbook create group Composers -ingroup $grpid] addressbook create person Beethoven -ingroup $subgrpid -</PRE><P><H3><A NAME="M11"></A> The [property names] command</H3> +</PRE><P><H3><A NAME="M11"></A>The [property names] subcommand</H3> Get the list of all existing properties for groups or for persons <PRE> addressbook property names -groups addressbook property names -persons -</PRE><P><H3><A NAME="M12"></A> The [property type] command</H3> +</PRE><P><H3><A NAME="M12"></A>The [property type] subcommand</H3> Get the type of a particular property <PRE> addressbook property type -groups UID addressbook property type -persons Address </PRE> For the two examples above, the result is respectively -<I>String</I> and <I>MultiDictionary</I>.<P><H3><A NAME="M13"></A> The [property add] command</H3> +<I>String</I> and <I>MultiDictionary</I>.<P><H3><A NAME="M13"></A>The [property add] subcommand</H3> Add a new person's property called <I>Instrument</I> with type <I>String</I> <PRE> addressbook property add -persons Instrument String </PRE><P>Add a new group's property called <I>Meeting</I> with type <I>Date</I> <PRE> addressbook property add -groups Meeting Date -</PRE><P><H3><A NAME="M14"></A> The [property remove] command</H3> +</PRE><P><H3><A NAME="M14"></A>The [property remove] subcommand</H3> Remove the properties created above: <PRE> addressbook property remove -persons Instrument addressbook property remove -groups Meeting -</PRE><P><H3><A NAME="M15"></A> The [export] command</H3> +</PRE><P><H3><A NAME="M15"></A>The [export] subcommand</H3> Create a VCard corresponding to a particular record: <PRE> set theid [lindex [addressbook persons -ids] 0] set vcardData [addressbook export $theid] </PRE> -The data returned is binary. You can store it in a file for instance.<P><H3><A NAME="M16"></A> The [import] command</H3> +The data returned is binary. You can store it in a file for instance.<P><H3><A NAME="M16"></A>The [import] subcommand</H3> Import in the database some information stored in a .vcf file. A new record containing this info, is created in the database: <PRE> @@ -189,14 +184,14 @@ set vcard [read $fid] close $fid addressbook import $vcard -</PRE><P><H3><A NAME="M17"></A> The [image] command</H3> +</PRE><P><H3><A NAME="M17"></A>The [image] subcommand</H3> Get the custom image corresponding to a particular record: <PRE> set theid [lindex [addressbook persons -ids] 0] set img [addressbook image $theid] </PRE> 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.<P><H3><A NAME="M18"></A> The [set] command</H3> +An error is raised if there is no custom image for this record.<P><H3><A NAME="M18"></A>The [set] subcommand</H3> 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: <PRE> @@ -215,7 +210,7 @@ permanent. <P> When setting the value of a field it is important that the new value be formatted correctly with respect to the type of the property, as explained -in the <A href="TclAddressBookHelp.html">help file</A>. Here are a few +in the <A HREF="TclAddressBookHelp.html">help file</A>. Here are a few examples corresponding to various property types: <UL> <LI> Multi string value @@ -232,7 +227,8 @@ </PRE><P> <LI> Multi dictionary value <PRE> addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75001} {Street "1, avenue de l'Opéra"}]]] -</PRE><P></UL><P><H3><A NAME="M19"></A> The [search] command</H3> +</PRE> +</UL><P><H3><A NAME="M19"></A>The [search] subcommand</H3> This command can be used to report the IDs of the records corresponding to a single criterion. The criterion is expressed by a three elements list: the first element is the name of a property, the second is a comparison operator and @@ -245,7 +241,7 @@ addressbook search -persons Modification < 1070199949 </PRE><P><P> When searching on a particular property, it is important that the searched value be formatted correctly with respect to the type of the property, -as explained in the <A href="TclAddressBookHelp.html">help file</A>. Specify +as explained in the <A HREF="TclAddressBookHelp.html">help file</A>. Specify an empty label or an empty key to search on all possible labels or keys respectively. Here are a few examples corresponding to various property types: <UL> @@ -274,8 +270,9 @@ <LI> Empty label and key to search on all labels and keys <PRE> addressbook search -persons -nocase Address >= {"" {"" abc}} -</PRE><P></UL><P><A name="ukl"></A> -<H2><A NAME="M20"></A> Using keyed lists</H2> +</PRE> +</UL><P><A NAME="ukl"></A> +<H2><A NAME="M20"></A>Using keyed lists</H2> Keyed lists can be easily manipulated using the <B> keylget </B> and <B>keylset</B> commands defined by the TclX extension. For instance, if a record has been stored in some variable <I>myrecord</I>, one can extract @@ -295,6 +292,6 @@ keylget grp GroupName clock format [keylget grp Modification] </PRE><P><HR> -<P> Last updated 2004-01-06 07:32:36<P> +<P> Last updated 2004-01-24 08:09:04<P> </BODY> </HTML> \ No newline at end of file |