Re: [Mysql-cocoa-users] SMySQL_test
Brought to you by:
sergecohen
From: Serge C. <co...@em...> - 2002-05-22 08:17:13
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi;=0D =0D indeed in C, C++, ObjC and many other language a =3D is a function which = =0D returns the assigned object.=0D Here the test is that fetchRowAsDictionnary returns nil if there is no =0D= more row to fetch:=0D then row =3D nil, and (row =3D ...) =3D nil (equivalent to NO or false).=0D= =0D It is then equivalent to :=0D while ((row =3D [result fetchRowAsDictionary]) !=3D nil)=0D =0D I guess this is the answer to your question.=0D =0D =0D Serge.=0D =0D Le mercredi 22 mai 2002, =C3=A0 06:37 AM, Famille GOUREAU-SUIGNARD a = =C3=A9crit :=0D =0D > Hi,=0D >=0D > I've got a problem with the following bunch of source file. It is used = =0D > (and works perfectly) in SMySQL_Test, the software that tests SMySQL =0D= > functions.=0D >=0D > SMySQLResult *result;=0D > NSDictionary *row;=0D > unsigned int count, i; =0D >=0D > result =3D [connection queryString:@"select * from test"];=0D > count =3D [result numOfFields];=0D >=0D > while (row =3D [result fetchRowAsDictionary]) {=0D > for (i=3D0; i<count; i++) {=0D > NSString *name =3D [names objectAtIndex:i];=0D > NSLog(@"%@ : %@\n", name, [row objectForKey:name]);=0D > }=0D > }=0D >=0D > My problem lies in the line : while (row =3D [result =0D > fetchRowAsDictionary]) {=0D > I'm quite new with C, C++ or ObjC, but I thought that between =0D > the "(...)" of a while there should be a test. The "=3D" instruction = is =0D > not a test...=0D >=0D > Does anybody have an idea to explain this syntax that is perfectly =0D > understood by PB (if not by me) ?=0D >=0D > Thanks.=0D >=0D > Camille=0D >=0D >=0D > _______________________________________________________________=0D >=0D > Don't miss the 2002 Sprint PCS Application Developer's Conference=0D > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm=0D= >=0D > _______________________________________________=0D > Mysql-cocoa-users mailing list=0D > Mys...@li...=0D > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users=0D >=0D >=0D - ----------------------------------------------------=0D Serge Cohen=0D =0D GPG Key ID: 1024D/69B1D346=0D - ----------------------------------------------------=0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE861SoMygj1Wmx00YRAlIeAJsHd5eCqVp8IG6CvhgF95pfs+jPCQCfVOx2 X9fqycbaR16/PpjX8IoTjt0=3D =3Dh3oj -----END PGP SIGNATURE----- |