Page 1 of 1

[Implemented] Constants in data

Posted: Tue Feb 14, 2017 2:53 pm
by MrTAToad
Continuing with datasections, it would be handy if constants could be used there too

Re: Constants in data

Posted: Wed Feb 15, 2017 1:03 pm
by MrTAToad
In addition, being able to use constants as default parameters in procedures would be useful to.

Re: Constants in data

Posted: Wed Feb 15, 2017 4:08 pm
by Fred
Both should work IIRC

Re: Constants in data

Posted: Wed Feb 15, 2017 5:05 pm
by Peter
@MrTAToad:

1.)

Code: Select all

#ConstantWithValue1 = 1
#ConstantWithValue2 = 2

Read Value
Debug Value ; -> 1

Read Value
Debug Value ; -> 2

DataSection
  Data.i #ConstantWithValue1, #ConstantWithValue2
EndDataSection

2.)

Code: Select all

#ConstantWithValue1 = 1

Procedure Test(Parameter = #ConstantWithValue1)
  Debug Parameter
EndProcedure

Test() ; -> 1
Test(10) ; -> 10
Greetings ... Peter

Re: Constants in data

Posted: Wed Feb 15, 2017 8:12 pm
by MrTAToad
Yes, they are working now, which is good!