William "Chops" Westfield wrote: > #macro counted_string var, s > #equ $s_n 0 > #irpc s > #equ $s_n $s_n+1 > #end // irpc to count chars > unsigned char var[$s_n+2] = { $s_n, // store count > #irpc s > 's', // store characters > #end //irpc to store chars > 0}; // null terminate just in case > #endmacro This looks like it should be possible in standard C: #define counted_string( mVarname, mStringliteral ) \ struct { \ unsigned char size; \ unsigned char content[sizeof(mStringliteral)]; \ } mVarname \ = { \ sizeof(mStringliteral), \ mStringliteral \ } Not quite the same, but possibly better style (in that it separates the size and the content into two different entities). If you need to access the size and the content as a single array, you can add a union around the struct. Still not the same (in that it needs the union qualifier to access the array), but that possibly could be remedied with yet another macro :) Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist