用循环得到表中所有的字段

static void loopFieldsInTable(Args _args)

{

    dictTable dt;

    int numberOfFields;

    int fieldId;

    int i;

    ;

    dt = new dictTable(tableNum(CustTable));

    //name of table

    info(dt.name());

    numberOfFields = dt.fieldCnt();

    info(int2str(numberOfFields));

    for (i = 1; i <= numberOfFields; i++)

    {

      fieldId = dt.fieldCnt2Id(i);

      info(dt.name()+'.'+dt.fieldName(fieldId));

    }

}

原文地址:https://www.cnblogs.com/Fandyx/p/2761523.html