I am tidying code again and wondered if there was an easy way to tidy this up.
I would rather not select * as listing the fields makes it more readable.
The part I would like to tidy up is the declaration of the 'L' var.
I could do it in a loop if the fields were all the same but there is a mixture of text and integers in there so the format code for the items will differ.
Keith
I would rather not select * as listing the fields makes it more readable.
The part I would like to tidy up is the declaration of the 'L' var.
I could do it in a loop if the fields were all the same but there is a mixture of text and integers in there so the format code for the items will differ.
Code:
SELECT TABLENAME,FEELD,CAPSHUN,FIELDTYPE,SHOWTYPE,REQDTYPE,FFORMAT,FCHECK FROM CAPTIONS INTO ARRAY CAPLIST
C=FCREATE(CAPNAME,0)
FOR X = 1 TO ALEN(CAPLIST) STEP 8
L = ALLTRIM(CAPLIST[x])+","+ALLTRIM(CAPLIST[x+1])+","+ALLTRIM(CAPLIST[x+2])+","+ALLTRIM(STR(CAPLIST[x+3]))+","+ALLTRIM(STR(CAPLIST[x+4]))+","+ALLTRIM(STR(CAPLIST[x+5]))+","+ALLTRIM(STR(CAPLIST[x+6]))+","+ALLTRIM(STR(CAPLIST[x+7]))+","+CHR(13)+CHR(10)
W=FWRITE(C,L)
NEXT
CL = FCLOSE(C)
Keith