Page 1 of 1

[03 Feb 2008] Problem with @DISPLAY

Posted: Sat Jun 13, 2020 5:31 pm
by jap
Note: This is an archived post that was originally sent to the Hollywood mailing list on 03 Feb 2008 11:25:54 +0300

Hello,

I'm trying to open a window like this:

Code: Select all

displayAttrs = {Title = "My Window", Color = #BLACK, Width = 640, Height = 480, Mode = "Windowed", Borderless = False, Sizeable = False, HideTitleBar = False} 
@DISPLAY displayAttrs
but Hollywood says that opening brace is missing from the "@DISPLAY" line. This summons the same error message:

Code: Select all

windowWidth = 640
windowHeight = 480
title$ = "My Window"
displayAttrs = {}
displayAttrs.Title = title$
displayAttrs.Color = #BLACK
displayAttrs.Width = windowWidth
displayAttrs.Height = windowHeight
displayAttrs.Mode = "Windowed"
displayAttrs.Borderless = False
displayAttrs.Sizeable = False
displayAttrs.HideTitleBar = False
@DISPLAY displayAttrs
And if I try something like this:

Code: Select all

windowWidth = 640
windowHeight = 480
title$ = "My Window"
@DISPLAY {Title = title$, Color = #BLACK, Width = windowWidth, Height = windowHeight, Mode = "Windowed", Borderless = False, Sizeable = False, HideTitleBar = False}
Hollywood rewards me with a "String expected!" error. Am I doing something wrong or is there a bug in the @DISPLAY command?

-- JANNE janne.email-address-removed@nospam.com

[03 Feb 2008] Re: Problem with @DISPLAY

Posted: Sat Jun 13, 2020 5:31 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 03 Feb 2008 11:24:41 +0100

You're doing something wrong. All @-commands are called "preprocessor commands". I.e. Hollywood evaluates them before the script execution actually starts. Thus, you cannot use variables here because variables are not there at the moment the preprocessor parses your script.

You need to write it the following way:

Code: Select all

@DISPLAY {Title = "My Window", Color = #BLACK, Width = 640, Height = 480, Mode = "Windowed", Borderless = False, Sizeable = False, HideTitleBar = False}

[03 Feb 2008] Re: Problem with @DISPLAY

Posted: Sat Jun 13, 2020 5:31 pm
by jap
Note: This is an archived post that was originally sent to the Hollywood mailing list on 03 Feb 2008 15:24:42 +0300

Hello Andreas,
You're doing something wrong. All @-commands are called "preprocessor commands". I.e. Hollywood evaluates them before the script execution actually starts. Thus, you cannot use variables here because variables are not there at the moment the preprocessor parses your script.
Ah, that's why it didn't work. Thanks!

-- JANNE janne.email-address-removed@nospam.com