简体   繁体   中英

Pascal: how to declare number of dimensions of a dynamic array during runtime?

我知道setlength(array,a,b ...)用于声明动态数组和维的长度,它需要您知道维数,因此如何声明n维(n是变量)?

This is not possible to vary the nesting level of normal (dynamic) arrays runtime.

But have a look at COM arrays, the vararray functions in unit variants though, afaik it is possible with those, but that is a purely library construct.

An example is at http:///www.stack.nl/~marcov/phpser.zip implementing a simple php array deserializer that decodes a nested structure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM