#define DATA_TOTAL 1001
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 在DATA_TOTAL循环中显示索引倍数为100的行
//--- 该字符串以四个字符格式显示索引值
//--- 如果字符串长度少于4个字符,则字符串中循环索引的值
//--- 前面以零开头
for(int i=0; i<DATA_TOTAL; i++)
{
if(i%100==0)
Print("Converted index value: ",IntegerToString(i,4,'0'));
}
/*
result:
Converted index value: 0000
Converted index value: 0100
Converted index value: 0200
Converted index value: 0300
Converted index value: 0400
Converted index value: 0500
Converted index value: 0600
Converted index value: 0700
Converted index value: 0800
Converted index value: 0900
Converted index value: 1000
*/
}
|