Microsoft Dynamics AX - System Class

System Class

Image Class

    //从文件中加载一个图像,并将其放在一个表中.
    Image 	image; 
    str 	filename;

    filename = myImagePath + myImageFile;

    if (Image::canLoad(filename)) 
    {
       image.loadImage(filename);
       myTable.imageContainer = image.getData();
    }

    //然后让这个图像在Form中展示出来
    Image 		image;
    container 	imageContainer;
    
    imageContainer = myTable.imageContainer;
    
    image = new Image();
    image.setData(imageContainer);
    
    imageWindow.image(image);
    imageWindow.widthValue(image.width());
    imageWindow.heightValue(image.height());

Map Class

Map特点

键值对容器,值允许重复,键不允许重复,容器内元素无序。

Map有三种取值方式

  1. 通过MapIterator类遍历获取;
  2. 通过MapEnumerator遍历获取;
  3. 直接获取。
Map             map = new Map(Types::String, Types::Integer);
MapEnumerator   me  = new MapEnumerator(map);

while(me.movenext())
{
    print me.currentKey();
    print me.currentValue();
}

第一种与第三种方式不再赘述,第二种方式与第一种方式类似,不同点是:第二种方式遍历期间不可以更改map的值

Array Class

Array和普通的数组功能基本是相同的,区别是:使用Array可以存储表缓冲Table Buffer和对象Object
Array中的元素必须都是同一种类型,所以定义时不能使用:

Array array = new Array(Types::AnyType);//这种写法时错误的,因为Array中的元素必须是一种类型的,这点和普通数组相同

Set Class

Set特点

Set中的元素是唯一且有序的

Set的两种取值方式

  1. 通过SetIterator类遍历获取;
  2. 通过SetEnumerator类遍历获取。
//实现方法与Map类似
//通过SetIterator类遍历获取
Set         set         = new Set(Types::String);
SetIterator setIterator = new SetIterator(set);

while(setIterator.more())
{
    setIterator.value();
    setIterator.next();
}

//通过SetEnumerator类遍历获取
SetEnumerator setEnumerator = new SetEnumerator(set);
while(setEnumerator.movenext())
{
    setEnumerator.next();
}

Container

特点

可以存储除对象以外所有的数据类型,包括Table Buffer。允许容器内数据重复。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值