Struct类
Struct可以拥有很多类型各不相同的字段和其值,也就相当于一行记录。
static
void StructJob(Args _args)
{
Struct m_Struct = new Struct(Types::Integer, " ID ",Types::String, " Name ");
int i;
;
m_Struct.value( " ID ", 2);
m_Struct.value( " Name ", " Luck ");
m_Struct.add( " Price ", 90);
m_Struct.add( " Level ", " VIP ");
info(m_Struct.toString());
for(i = 1;i<=m_Struct.fields();i++)
{
info(strfmt( " fieldN:%1,fieldT:%2,fieldV:%3 ",m_Struct.fieldName(i),m_Struct.fieldType(i),m_Struct.valueIndex(i)));
}
}
{
Struct m_Struct = new Struct(Types::Integer, " ID ",Types::String, " Name ");
int i;
;
m_Struct.value( " ID ", 2);
m_Struct.value( " Name ", " Luck ");
m_Struct.add( " Price ", 90);
m_Struct.add( " Level ", " VIP ");
info(m_Struct.toString());
for(i = 1;i<=m_Struct.fields();i++)
{
info(strfmt( " fieldN:%1,fieldT:%2,fieldV:%3 ",m_Struct.fieldName(i),m_Struct.fieldType(i),m_Struct.valueIndex(i)));
}
}