Text Sort Order
Order fields based on the text of the field.
- Compare text fields
-
Compare two fields on the basis of their characters.
- Notes
-
This is a split segment due to the perverse coding practice
of embedding the macro at the site of the first call.
Segment Element
Code insertion
-
1090: else if (ignore && translate)
1091:
Segment Element
Code insertion
-
1139: CMP_WITH_IGNORE (translate[UCHAR (*texta)], translate[UCHAR (*textb)]);
1140: else if (ignore)
1141: CMP_WITH_IGNORE (UCHAR (*texta), UCHAR (*textb));
1142: else if (translate)
1143: while (texta < lima && textb < limb)
1144: {
1145: if (translate[UCHAR (*texta++)] != translate[UCHAR (*textb++)])
1146: {
1147: diff = (translate[UCHAR (*--texta)]
1148: - translate[UCHAR (*--textb)]);
1149: break;
1150: }
1151: }
1152: else
1153: diff = memcmp (texta, textb, min (lena, lenb));
1154:
- Determine final sort order
-
Code insertion
-
Use length to resolve an ambigous text comparision.
- Segment Source
- 1155: if (diff)
1156: return key->reverse ? -diff : diff;
1157: if ((diff = lena - lenb) != 0)
1158: return key->reverse ? -diff : diff;
1159: }