FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
October 01, 1999

The Small Scripting Language

(Page 3 of 8)
Oct99: The Small Scripting Language


(a)
bool: ispacked(string[])
      return bool: (string[0] > charmax);

(b) 
strlen(string[])
   {
   new len = 0;
   if (ispacked(string))
       while (string{len} ! '^0')     /* get character from pack */
           ++len;
   else
       while (string[len] ! = '^0')     /* get cell */
           ++len;
   return len;
   }

Example 2: (a) Function that distinguishes packed from unpacked strings; (b) the strlen() function that works on packed and unpacked strings.


Copyright © 1999, Dr. Dobb's Journal
Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK