@DISPLAY vs CreateDisplay arguments

Find quick help here to get you started with Hollywood
Post Reply
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

@DISPLAY vs CreateDisplay arguments

Post by amyren »

Is there any reason why @DISPLAY does not accept variables for arguments, while CreateDisplay does?

I made an example to show what works.

Code: Select all

mywidth = 600
myheight = 400
mycol = "$959595"
CreateBGPic(1, mywidth-400, myheight-300, #WHITE)
@DISPLAY {width = 800, height = 600, color = #GREEN}
CreateDisplay(2, { Width = mywidth, Height = myheight, color = mycol})
OpenDisplay(2)
CreateDisplay(3, { bgpic = 1})
OpenDisplay(3)
Wait(100)
This will not work, since @DISPLAY does not seem to take any arguments.

Code: Select all

@DISPLAY { Width = mywidth, Height = myheight, color = mycol})
Also, @DISPLAY does not accept the argument bgpic = 1
User avatar
emeck
Posts: 169
Joined: Fri Apr 03, 2015 3:17 pm

Re: @DISPLAY vs CreateDisplay arguments

Post by emeck »

@DISPLAY is a preprocessor command, which are processed before the rest of the script, so your variables mywidth, myheight and mycol don't exist yet.
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

Re: @DISPLAY vs CreateDisplay arguments

Post by amyren »

emeck wrote: Tue Jun 18, 2019 2:09 pm @DISPLAY is a preprocessor command, which are processed before the rest of the script, so your variables mywidth, myheight and mycol don't exist yet.
Thank you, that explains it. I was not aware of that preprocessor also ment that it would be processed before any code written above.
Post Reply