Q:

Confusion as to the meaning of `cid` in webform.module

I'm working on a custom module that will return a single question at a time from an existing webform. For example, from the path mymodule/(webform_nid)/(question).
This is my first encounter with cid.
From the documentation on webform_components_form(), it appears that cid represents a component id. (Elsewhere in the Drupal API documentation and on forums, I have seen it referred to as comment id).
Quickly analyzing some test data, it appears that, as a child element of a webform nid, I can reliably use it to sequentially retrieve single questions from a given webform nid.
Am I correct that cids are unique and sequential per nid? I assume the implementation of cid was done to maintain variable name convention.
Or is a cid a unique value assigned to each 'component' across the entire site, as its implementation as comment id would suggest (because you can load an existing comment without loading its node, it would need to be a globally-unique value like nid)?

A:

A quick look at the webform_component table in the database, the description for that field is: "The identifier for this component within this node, starts at 0 for each node."
In my test, however, the first component has a cid of 1.  AND - keep in mind that if you delete a component, the next cid is incremental - so you can't assume 1 - 6 or whatever.

