Toolkit Tutorial: Programming
dt_Handle
atom1
,
atomX
;
dt_Integer
number
,
slen
,
charge
;
dt_String
symbol
;
atom1
=
dt_next
(
container
);
number
=
dt_number
(
atom1
);
symbol
=
dt_symbol
(
&
slen
,
atom1
);
charge
=
dt_charge
(
atom1
);
printf
(
"The atom number is %d, the symbol is \"%.*s\", "
"and the charge is %d.\n"
,
number
,
slen
,
symbol
,
charge
);
atomX
=
dt_next
(
container
);
number
=
dt_number
(
atomX
);
symbol
=
dt_symbol
(
&
slen
,
atomX
);
charge
=
dt_charge
(
atomX
);
printf
(
"The atom number is %d, the symbol is \"%.*s\", "
"and the charge is %d.\n"
,
number
,
slen
,
symbol
,
charge
);
atomX
=
dt_next
(
container
);
if
(
NULL_OB
==
atomX
)
printf
(
"The NULL object is next.\n"
);
dt_reset
(
container
);
atomX
=
dt_next
(
container
);
if
(
atomX
==
atom1
)
printf
(
"Reset is like rewind.\n"
);
if
(
dt_parent
(
atomX
)
==
molecule
);
printf
(
"You can access the molecule through the atom\n"
);