Any risk in using Hollywood reserved CONSTs?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 1168
Joined: Sun Feb 14, 2010 7:11 pm

Any risk in using Hollywood reserved CONSTs?

Post 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?
User avatar
emeck
Posts: 169
Joined: Fri Apr 03, 2015 3:17 pm

Re: Any risk in using Hollywood reserved CONSTs?

Post 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?
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Any risk in using Hollywood reserved CONSTs?

Post 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 :)
User avatar
emeck
Posts: 169
Joined: Fri Apr 03, 2015 3:17 pm

Re: Any risk in using Hollywood reserved CONSTs?

Post 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.
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Post Reply