[03 Feb 2008] Problem with @DISPLAY

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
jap
Posts: 61
Joined: Sun Feb 14, 2010 12:24 pm
Contact:

[03 Feb 2008] Problem with @DISPLAY

Post 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
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[03 Feb 2008] Re: Problem with @DISPLAY

Post 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}
User avatar
jap
Posts: 61
Joined: Sun Feb 14, 2010 12:24 pm
Contact:

[03 Feb 2008] Re: Problem with @DISPLAY

Post 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
Locked