Page 1 of 1
More Datasection/Const Flexibility
Posted: Wed Jan 04, 2017 10:59 pm
by GenRabbit
I'd like to have these posibilities; It would be nice to let the compiler calculate it so You don't have to do it at runtime. (less Variables to keep track of)
Code: Select all
#LENGTH_WORD = 2
DataSection
BeginMaxActorsInGroup:
Data.w 5,10,15,20,25,50,100,250,500,1000
EndMaxActorsInGroup:
Data.l (?EndMaxActorsInGroup - ?BeginMaxActorsInGroup) /#LENGTH_WORD ; This one
EndDataSection
#DataLength = (?EndMaxActorsInGroup - ?BeginMaxActorsInGroup) /#LENGTH_WORD ; This one
Re: More Datasection/Const Flexibility
Posted: Thu Jan 05, 2017 11:18 am
by GPI
I think, the problem is, that address are calculated during realtime. For a human it is easy to see, that the length is a fixed value, but the compiler has problems here.
maybe it is possible to extend the SizeOf()?
SizeOf(BeginMaxActorsInGroup,EndMaxActorsInGroup)
Re: More Datasection/Const Flexibility
Posted: Thu Jan 05, 2017 1:37 pm
by nco2k
personally i would be happy if we could assign labels to constants in general:
Code: Select all
#Test = ?blahblahblah
DataSection
blahblahblah:
Data.b $74, $65, $73, $74, $00
EndDataSection
dont other languages support something like this? it should be doable.
c ya,
nco2k
Re: More Datasection/Const Flexibility
Posted: Thu Jan 05, 2017 5:51 pm
by GenRabbit
I suppose the compiler could flag the variables as it registers them if they are static or dynamic. NCO2K example could be added simultanously
Re: More Datasection/Const Flexibility
Posted: Mon Jan 09, 2017 3:28 am
by Tenaja
nco2k wrote:personally i would be happy if we could assign labels to constants in general:
Code: Select all
#Test = ?blahblahblah
DataSection
blahblahblah:
Data.b $74, $65, $73, $74, $00
EndDataSection
dont other languages support something like this? it should be doable.
c ya,
nco2k
Yes, we have that already.