| File name: ProcessEveryRec.pql | Creator: Tom Shriver | Created: 10/16/2007 | Reason: | Output: Nothing so far . string * 210 REC1 REC2 REC3 REC4 | Lists of record type numbers to create the globals used by DO REPEAT . integer * 2 MAXREC# | Maximum record types for this database . integer * 2 MAXLEN# | Total maximum length of global string . integer * 1 GLINE# | Global line number . set REC1 REC2 REC3 REC4 ('') . MAXREC# = nrecs(0) . GLINE# = 1 . MAXLEN# = 200 . for REC# = 1, MAXREC# . ifthen (numrecs(REC#) > 0) | Must have at least one record or checking even empty record types: ifthen (nkeys(REC#) > 0) . REC1 to REC4(GLINE#) = REC1 to REC4(GLINE#) + format(rec#) + "," | Create string of record type numbers, i.e. '1,2,4,6,11,' . if (len(REC1 to REC4(GLINE#)) > MAXLEN#) GLINE# = GLINE# + 1 | If first string is longer than MAXLEN#, start new variable . endif . end for . REC1 to REC4(GLINE#) = sbst(REC1 to REC4(GLINE#),1,len(REC1 to REC4(GLINE#)) - 1) | Remove last comma from last line . x = globals("GREC1",REC1) | Make a global out of the string . ifthen (len(REC2) > 0) . x = globals("GREC2",REC2) | If necessary make more globals . ifthen (len(REC3) > 0) . x = globals("GREC3",REC3) . ifthen (len(REC4) > 0) . x = globals("GREC4",REC4) . endif . endif . endif end program | Test the results print back commands repeat program do repeat GVAR = write " !GVAR" end repeat end program print back nocommands norepeat