Computer Science Canada

Types and Flexible Arrays

Author:  Degensquared [ Thu Nov 27, 2008 4:39 pm ]
Post subject:  Types and Flexible Arrays

I'm having an issue with declaring a flexible array as a part of a type. The compiler throws an error or two at me when I use the following code:

code:

type test_type :
    record
        test_array : flexible array 1 .. 0 of int % flexible Highlighted -- Syntax error at 'flexible'
    end record % end Highlighted -- Extra 'end'


Am I missing something? Is this something that Turing does not allow?

Author:  Tony [ Thu Nov 27, 2008 4:57 pm ]
Post subject:  RE:Types and Flexible Arrays

see http://compsci.ca/v3/viewtopic.php?t=9636

Quote:

Straight out of Turing's help files on records: Any array contained in a record must have bounds that are known at compile time.


You could have a pointer that points to a flexible array though.


: