Page 1 of 1
Any risk in using Hollywood reserved CONSTs?
Posted: Tue Jan 19, 2021 10:44 am
by Bugala
Today I was about to do following:
Code: Select all
const #UP = 1
const #RIGHT = 2
const #DOWN = 3
const #LEFT = 4
and on compile I got error on both #RIGHT and #LEFT as in that they have already been reserved.
In this case I am not using them for any calculations, but they are used on switch and if statements.
Therefore, is there any risk in using Hollywoods reserved consts?
Also, is there a list of Hollywoods reserved Consts somewhere?
Re: Any risk in using Hollywood reserved CONSTs?
Posted: Tue Jan 19, 2021 5:08 pm
by emeck
Also, is there a list of Hollywoods reserved Consts somewhere?
You can get those running:
Code: Select all
hollywood dummy.hws -exportconstants output.file
The dummy.hws file only has one line containing "
End()"
@Andreas
Is it possible to run Hollywood without a script for getting this kind of info?
Re: Any risk in using Hollywood reserved CONSTs?
Posted: Fri Jan 22, 2021 12:16 am
by airsoftsoftwair
emeck wrote: ↑Tue Jan 19, 2021 5:08 pm
Is it possible to run Hollywood without a script for getting this kind of info?
The script needn't exist because it will never be run when using -exportconstants or -exportcommands. It's just a matter of syntax so you can pass whatever you want. It's just that filename argument needs to be there.
Therefore, is there any risk in using Hollywoods reserved consts?
No, their value will stay the same in future versions. That's why they are called constants

Re: Any risk in using Hollywood reserved CONSTs?
Posted: Sat Jan 30, 2021 8:36 pm
by emeck
The script needn't exist because it will never be run when using -exportconstants or -exportcommands. It's just a matter of syntax so you can pass whatever you want. It's just that filename argument needs to be there.
Thanks for the tip.