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))); } }
转载于:https://www.cnblogs.com/Kurodo/archive/2011/10/09/2203847.html
相关资源:JAVA上百实例源码以及开源项目