-1

KEY:VALUEコールドフュージョンのペアの非常に長いリストがあります。サンプルとして

<!--- Info --->
request.INFO = StructNew();
request.INFO.isImportArchiv = false;
request.INFO.lImportArchiv = "";
request.INFO.recordcount = 0;
request.INFO.recordImported = 0;
request.INFO.recordInvalid = 0;
request.INFO.recordNotImported = 0;
request.INFO.recordNotInDB = 0
request.INFO.isImportOK = false;
request.INFO.recordInDBInserted = 0;

<!---  Log messages --->
request.LOG = StructNew();
request.LOG.import =            "*************************";
request.LOG.importStart =       "*************************";
request.LOG.importFinished =    "*************************";
request.LOG.import*** =         "*************************";
request.LOG.importAborted =     "*************************";
request.LOG.*** =               "*************************";
request.LOG.****** =            "*************************";
request.LOG.count =             "*************************";
request.LOG.onvalidObjects =    "*************************";
request.LOG.count*** =          "*************************";
request.LOG.count***** =        "*************************";
request.LOG.******** =          "*************************";
request.LOG.***** =             "*************************";
request.LOG.********** =        "*************************";
request.LOG.************** =    "*************************";
request.LOG.************** =    "*************************";
request.LOG.**************** =  "*************************";

ColdFusion でそのような Info 構造を管理するより良い方法はありますか?

4

1 に答える 1

1

CF8 以降を使用している限り、構造体リテラルを使用して入力の一部を減らすことができます。

<cfscript>
request.INFO = {
    isImportArchiv = false,
    lImportArchiv = "",
    recordcount = 0,
    recordImported = 0,
    recordInvalid = 0,
    recordNotImported = 0,
    recordNotInDB = 0,
    isImportOK = false,
    recordInDBInserted = 0
};
</cfscript>
于 2013-04-11T16:22:22.777 に答える