Are the dynamic arrays in DOORS data base worth using?

核能气质少年 提交于 2019-12-05 23:01:10

问题


I am a new developer for a DOORS database and when writing scripts in dxl. If you know there are only 1 dimensional arrays in dxl. I wanted to use more than one dimension so I decided to use a dynamic array, but this slowed my script down a lot, and when we have around 14000 objects per module it would take a day or so for the script to run.

I was wondering if it is reasonable to use dynamic arrays in these scripts or if anyone has experience in dealing with dynamic arrays in databases?

Just curious thanks!


回答1:


Dynamic arrays are considerably slower than C style arrays in DOORS, so you should avoid them if you know the size of the array beforehand.

If you know the number of elements but need more dimensions you can do it like this:

//Define an array of (for example) bool
int imax=5
int jmax=7
bool myarray[imax*jmax]

//Access for example element myarray[3][2]
int i=3
int j=2
bool mybool=myarray[i*jmax+j]


来源:https://stackoverflow.com/questions/960146/are-the-dynamic-arrays-in-doors-data-base-worth-using

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!