Computer Science Canada Changing upper bound of flexible array inside of a procedure |
Author: | jQwotos [ Mon Mar 06, 2017 1:03 pm ] | ||||
Post subject: | Changing upper bound of flexible array inside of a procedure | ||||
What is it you are trying to achieve? Is it possible to change the upper bound of a flexible array inside of a procedure when it is passed as a variable argument? In addition, is it possible to declare a flexible array inside of a record? What is the problem you are having? I can't change the upper bound of a flexible array inside of a procedure. I know we can pass a flexible array into a procedure by doing this
But I want to do something like this
Please specify what version of Turing you are using OpenTuring V1.2.0 beta (Running in Wine on a Mac) |
Author: | pttptppt [ Mon Mar 06, 2017 10:25 pm ] |
Post subject: | RE:Changing upper bound of flexible array inside of a procedure |
I could be very wrong as Im a complete noob. But Im pretty sure the first example is not actually a flexible array. From what Ive used in flexible arrays, the format is like: var list: flexible array 1 .. 0 of typeSpec and then new list, 10 I have never done that by putting it in a procedure parameters like that but you could get around that very easily, though not as efficiently. Perhaps if you share what your trying to accomplish, I can provide an alternative? Otherwise hope someone from this inactive forum site responds! |
Author: | jQwotos [ Mon Mar 06, 2017 10:29 pm ] | ||||
Post subject: | RE:Changing upper bound of flexible array inside of a procedure | ||||
this would be my deceleration and procedure
because turing doesn't like
because it won't accept "flexible" when trying to pass it into the procedure |
Author: | Insectoid [ Thu Mar 09, 2017 12:38 pm ] |
Post subject: | RE:Changing upper bound of flexible array inside of a procedure |
Turing is incomplete and flexible arrays are one of the features that was never completely implemented. I recommend avoiding them, and just using large fixed-length arrays instead. |