SCREEN_EXIT

Forum for discussion about the documentation project.
Lothar Schirm
Posts: 359
Joined: Sep 28, 2013 15:08
Location: Germany

SCREEN_EXIT

Postby Lothar Schirm » Apr 05, 2021 10:36

In the FreeBASIC manual I found in the index "Screen(Graphics)" the following note:

Code: Select all

Note on using Screen 0
Screen 0 closes any graphics window, but also clears the console window if it exists.
Screen 0, , , SCREEN_EXIT (with SCREEN_EXIT=&h80000000) also closes any graphics window, but does not clear the console window if it exists (previous text is preserved).

This is a very interesting feature, but just writing

Code: Select all

Screen 0, , , SCREEN_EXIT

does not work, I get a compiler error message:

Code: Select all

Grafik_schliessen.bas(12) error 8: Undefined symbol, SCREEN_EXIT in 'Screen 0, , , SCREEN_EXIT

I tried also #include "fbgfx.bi" and FB.SCREEN_EXIT, but I got the same error message.
The constant SCREEN_EXIT seems to be defined nowhere, you must use &h80000000, not so nice! Is this an error in the documentation, or has it been forgotten to define the constant SCREEN_EXIT, e.g. in fbgfx.bi?
fxm
Posts: 10263
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: SCREEN_EXIT

Postby fxm » Apr 05, 2021 11:08

fxm wrote:@admin,
Flag "[GFX_]SCREEN_EXIT" (&h80000000) to be added in documentation and in fbgfx.bi?

Flag only significant when used with Screen 0 (closing any graphics window and preserving the console window content):
SCREEN 0, , , &h80000000

See Fbgfx , not erase txt console when closing graphic mode

fxm wrote:Documentation update:
KeyPgScreengraphics → fxm [Added note on using 'Screen 0, , , SCREEN_EXIT' (with SCREEN_EXIT=&h80000000) to close any graphics window while preserving the console window if it exists]
(this capacity has always existed since at least the FreeBASIC 0.12 Beta version)
Lothar Schirm
Posts: 359
Joined: Sep 28, 2013 15:08
Location: Germany

Re: SCREEN_EXIT

Postby Lothar Schirm » Apr 05, 2021 14:01

Thank you, fxm!
fxm
Posts: 10263
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: SCREEN_EXIT

Postby fxm » Apr 14, 2021 19:16

@admin:

Have you seen my proposal to add a flag in fbgfx.bi ?

fxm wrote:
fxm wrote:@admin,
Flag "[GFX_]SCREEN_EXIT" (&h80000000) to be added in documentation and in fbgfx.bi?

Flag only significant when used with Screen 0 (closing any graphics window and preserving the console window content):
SCREEN 0, , , &h80000000

See Fbgfx , not erase txt console when closing graphic mode

fxm wrote:Documentation update:
KeyPgScreengraphics → fxm [Added note on using 'Screen 0, , , SCREEN_EXIT' (with SCREEN_EXIT=&h80000000) to close any graphics window while preserving the console window if it exists]
(this capacity has always existed since at least the FreeBASIC 0.12 Beta version)
coderJeff
Site Admin
Posts: 3456
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: SCREEN_EXIT

Postby coderJeff » Apr 15, 2021 1:43

I see it now. lol
This seems like an easy one.

EDIT:
OK, added as "GFX_SCREEN_EXIT" for consistent naming with other constants.
fxm
Posts: 10263
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: SCREEN_EXIT

Postby fxm » Apr 15, 2021 6:18

coderJeff wrote:I see it now. lol
This seems like an easy one.

EDIT:
OK, added as "GFX_SCREEN_EXIT" for consistent naming with other constants.

Jeff, not well seen !
the value is '&h80000000', and not '&h800000001' (does not work).

'changelog.txt' and 'fbgfx.bi' to be modified.
coderJeff
Site Admin
Posts: 3456
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: SCREEN_EXIT

Postby coderJeff » Apr 15, 2021 11:51

The new constant value does work.
The definition in gfxlib is literally: "#define SCREEN_EXIT ((int)0x80000000)"
So it's specifically typed as 'LONG' from fb's point of view

In gfxlib.bi it's lower case '&h80000000l'
it's an 'L' suffix for long: '&H80000000' + 'L'

Probably doesn't matter on fbc side.
And I made the 'L' lower case as in 'l', sorry.
fxm
Posts: 10263
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: SCREEN_EXIT

Postby fxm » Apr 15, 2021 12:15

Excuse me!
At my age (70), I sometimes confuse the '1' and the 'l' in the teletype font.
paul doe
Posts: 1376
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: SCREEN_EXIT

Postby paul doe » Apr 15, 2021 18:54

fxm wrote:...I sometimes confuse the '1' and the 'l' in the teletype font.

Please, do not confuse the '1' with the 'l', except under confusing circumstances!
dodicat
Posts: 6888
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: SCREEN_EXIT

Postby dodicat » Apr 15, 2021 19:59

70 plus aid.

Code: Select all


Sub Magnify()
    #define resetwheel(w,fl) fl=w
    #define wheel(w,f) w-f
    Dim As Integer mx,my,mw,button:Getmouse mx,my,mw,button
    Static As Integer flag,pmw
    mw=(mw/2)
   If button=2 Then  resetwheel(mw,flag)
    Dim As Ulong array(1 To 6561),count
    pmw=wheel(mw,flag)
    if pmw<=1 then exit sub
    For z As Integer=1 To 2
        For x As Integer=mx-40 To mx+40
            For y As Integer=my-40 To my+40
                count+=1
                If z=1 Then array(count)=Point(x,y)
                If z=2 Then
                    var NewX=pmw*(x-mx)+mx:var NewY=pmw*(y-my)+my
                    line(newx-pmw/2,newy-pmw/2)-(newx+pmw/2,newy+pmw/2),array(count),bf
                End If
            Next y
        Next x
        count=0
    Next z
    Line(mx-pmw*40,my-pmw*40)-(mx+pmw*40,my+pmw*40),5,B
End Sub

#undef pointer
sub pointer
      dim as integer x,y
      screencontrol 12,x,y
      line(x-50,y-50)-(x-5,y-5)
      line(x-5,y-5)-(314,225)
      line(x-5,y-5)-(305,232)
      draw string(234,179),"Number one"
      line(x+50,y-50)-(x-5+20,y-5)
      line (x-5+20,y-5)-(334,224)
      line (x-5+20,y-5)-(345,231)
      draw string(349,179),"Letter el"
end sub

screen 12

do
screenlock
cls
locate 5,10
print "Roll mouse wheel"
locate 12,12
draw string(320,240),"1l"'
pointer
magnify
screenunlock
sleep 1
loop until len(inkey)
sleep

Return to “Documentation”

Who is online

Users browsing this forum: No registered users and 7 guests