Packing Commas in a Quiz - but not too many

Max Buten maxbuten@home.com
Thu, 07 May 1998 23:14:52 -0400


The college likes to address its designees as John Jones, CLU, ChFC, RHU
- 
if Mr Jones has those designations.  I'm having trouble getting the
right number of commas.  The Quiz code I'm using (on HP3000 in version
7.09)
is this:

DEF CLU  CHA*04 = "CLU " if he's earned a CLU
DEF CHFC CHA*04 = "ChFC" if he's earned that one
DEF RHU  CHA*04 = "RHU " if he's earned it
DEF FULL-NAME CHA*40 = PACK("John Jones" + ", " + CLU + ", " + CHFC + ",
" + RHU)

This works fine for somebody with CLU.  However if Jones only has RHU, I
get 

John Jones,,, RHU

which is pretty ugly.  

John Jones, RHU    would be much better.

Surely, somebody has faced and solved this problem?

Max
-- 
Max Buten - Powerhouse Programming Consultant - maxbuten@home.com -(610)
664 2301
at The American College: MaxB@AmerColl.edu - fax:(610) 526 1276  - (610)
526 1297
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.