Screen size

Just starting out? Need help? Post your questions and find answers here.
samxxx
User
User
Posts: 10
Joined: Sun Oct 09, 2022 5:17 pm

Screen size

Post by samxxx »

;- Screen constants
#SCREEN_WIDTH = 640
#SCREEN_HEIGHT = 480

;- Window Title
Title$ = "Blank Program"
;This is the start of our initialisation section - all we're doing here is setting up some variables & contants that will get used later. The most important constants are #SCREEN_WIDTH and #SCREEN_HEIGHT, as these define the display area.

; Initialistion code...
; 1. create a window

If OpenWindow(#Window_0, 216, 0, #SCREEN_WIDTH, #SCREEN_HEIGHT, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered , Title$)

;If CreateGadgetList(WindowID())

;EndIf
;EndIf

I am getting an Error with this screen Title$ - number expected instead of string. I am stuck!
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1285
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Screen size

Post by Paul »

Guess you haven't looked at the PureBasic Help file...
Syntax
Result = OpenWindow(#Window, x, y, InnerWidth, InnerHeight, Title$ [, Flags [, ParentWindowID]])
Maybe your code came from a very old online book?
Image Image
User avatar
Caronte3D
Addict
Addict
Posts: 1365
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Screen size

Post by Caronte3D »

:? samxxx, can you make a response to this thread saying you aren't a bot?
Olli
Addict
Addict
Posts: 1251
Joined: Wed May 27, 2020 12:26 pm

Re: Screen size

Post by Olli »

Post Reply