+static int FuncStrAt (void)
+/* Handle the .STRAT function */
+{
+ char Str [sizeof(SVal)];
+ long Index;
+
+ /* String constant expected */
+ if (Tok != TOK_STRCON) {
+ Error (ERR_STRCON_EXPECTED);
+ NextTok ();
+ return 0;
+
+ }
+
+ /* Remember the string and skip it */
+ strcpy (Str, SVal);
+ NextTok ();
+
+ /* Comma must follow */
+ ConsumeComma ();
+
+ /* Expression expected */
+ Index = ConstExpression ();
+
+ /* Must be a valid index */
+ if (Index >= (long) strlen (Str)) {
+ Error (ERR_RANGE);
+ return 0;
+ }
+
+ /* Return the char, handle as unsigned. Be sure to translate it into
+ * the target character set.
+ */
+ return (unsigned char) TgtTranslateChar (Str [(size_t)Index]);
+}
+
+
+
+static int FuncStrLen (void)
+/* Handle the .STRLEN function */
+{
+ /* String constant expected */
+ if (Tok != TOK_STRCON) {
+
+ Error (ERR_STRCON_EXPECTED);
+ /* Smart error recovery */
+ if (Tok != TOK_RPAREN) {
+ NextTok ();
+ }
+ return 0;
+
+ } else {
+
+ /* Get the length of the string */
+ int Len = strlen (SVal);
+
+ /* Skip the string */
+ NextTok ();
+
+ /* Return the length */
+ return Len;
+
+ }
+}
+
+
+