Page 1 of 1

type data elements individually

Posted: Fri Apr 19, 2013 11:02 pm
by Tenaja
I'd like to wish for the ability to mix strings and numbers in Data. Since strings are turned into pointers, would this not be possible?

Code: Select all

Data.i 5, "text1"
Data.i 432, "text2"
Alternatively, (and maybe even preferably) can we type each data element individually?

Code: Select all

Data 432.i, "text2", 5.b    ; strings are "auto-typed"
Data 976.i, "MoreText", 8.b
The reason for the request:
At this time, a loop is required to initialize an array (which is a hack to those who have worked with languages with array initialization), and it also requires separate data lines for every data type. Those two limitations severely diminish readability as well as ease of maintenance. This requested feature would allow a more compact (easier-to-read) method to initialize array sets and/or structures.

Thanks.

Re: type data elements individually

Posted: Sat Apr 20, 2013 1:23 am
by Demivec
Tenaja wrote:I'd like to wish for the ability to mix strings and numbers in Data. Since strings are turned into pointers, would this not be possible?
Just to update your information, the strings stored in a DataSection are literals, not pointers.


It would be nice if something could be done for the situation described. Here is another feature request for a slightly different way of dealing with it (in the syntax).