public static void main(String[] args) throws Exception {
COBOLFunction func = new SAMPLE4();
func.setArgs(args);
func.execute();
}
/**
* ALPのインスタンスです。
*/
public COBOLDataBean ALP_ins = new COBOLDataBean("01", "ALP", "X", -1, 26, -1, -1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", " ", ".ALP", null, null);
/**
* IN-DATAのインスタンスです。
*/
public COBOLDataBean IN_DATA_ins = new COBOLDataBean("01", "IN_DATA", "X", -1, 1, -1, -1, null, " ", ".IN_DATA", null, null);
/**
* COUNTERのインスタンスです。
*/
public COBOLDataBean COUNTER_ins = new COBOLDataBean("01", "COUNTER", "9", -1, 2, 2, -1, null, "00", ".COUNTER", null, null);
/**
* コンストラクタ
* @throws Exception 実行時例外
*/
public SAMPLE4() throws Exception {}
/**
* 処理開始
* @throws Exception 実行時例外
*/
public SAMPLE4 execute() throws Exception {
Log.setMonitor("SAMPLE4.SAMPLE4");
String[] args = getArgs();
L_SAMPLE4();
return this;
}
// START-SECTION node=sample-cobol\SAMPLE4.cob::12行目
/**
* 主制御関数
* @param args 引数
* @throws Exception 実行時例外
*/
public int L_SAMPLE4() throws Exception {
// sample-cobol\SAMPLE4.cob::13行目
display("英大文字を1字、入力してください。>> ");
// sample-cobol\SAMPLE4.cob::14行目
IN_DATA_ins.set(".IN_DATA", accept());
// sample-cobol\SAMPLE4.cob::15行目
for (COUNTER_ins.set(".COUNTER", 1L); ;COUNTER_ins.add(".COUNTER", 1L)) {
// sample-cobol\SAMPLE4.cob::16行目
if (COBOLUtil.cond(COUNTER_ins.get(".COUNTER"), ">", 26L)) {
break;
}
// sample-cobol\SAMPLE4.cob::20行目
if (COBOLUtil.cond(IN_DATA_ins.get(".IN_DATA"), "==", ALP_ins.get(".ALP").substring(COUNTER_ins.getN(".COUNTER").longValue(), 1L))) {
// ----------------------------------------------------------------
// sample-cobol\SAMPLE4.cob::22行目
break;
}
// END-IF node=sample-cobol\SAMPLE4.cob::20行目
}
// END-PERFORM node=sample-cobol\SAMPLE4.cob::15行目
// sample-cobol\SAMPLE4.cob::25行目
if (COBOLUtil.cond(COUNTER_ins.get(".COUNTER"), "<=", 26L)) {
// sample-cobol\SAMPLE4.cob::26行目
display(IN_DATA_ins.get(".IN_DATA")+"は、アルファベットで"+COUNTER_ins.get(".COUNTER")+"番目の文字です。"+"\n");
} else {
// sample-cobol\SAMPLE4.cob::28行目
display("入力文字に誤りがあります。"+"\n");
}
// END-IF node=sample-cobol\SAMPLE4.cob::25行目
return 0;
}
// END-SECTION node=sample-cobol\SAMPLE4.cob::12行目
}