function that does not let me load a screen more than once

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

function that does not let me load a screen more than once

#1 Post by digitsoft »

Hello Roger
In Express there is a function that does not let me load a screen more than one
Nolberto Paulino
Regards

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: function that does not let me load a screen more than on

#2 Post by bwolfsohn »

This is what i used to use (before i retired :) )

if is_this_window_open( cWindowName )
return(nil)
endif

***************************
function is_this_window_open( cWindowName )
***************************
local lRetval:=.f.,i
local oMainwindow:=SetAppwindow()
local nDeskTopWindows := Len(AppDeskTop():childList())
local nChildWindows,aChildList

// added in case oMainwindow does not have drawing area
IF !ismembervar(oMainWindow,"drawingarea")
return(lRetval)
ENDIF
nChildWindows := Len(oMainWindow:drawingarea:childList())
aChildList := oMainWindow:drawingarea:childList()


IF (nDesktopWindows >2 .OR. nChildWindows>1) .AND. !Empty(cWindowName)
FOR i := 1 TO nChildwindows
IF ismembervar(aChildList,"title")
IF aChildList:title == cWindowName
err_msg("Cannot open "+cWindowName+" twice")
SetAppFocus(aChildList)
lRetVal := .t.
EXIT
ENDIF
ENDIF
NEXT
ENDIF
return(lRetval)
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: function that does not let me load a screen more than on

#3 Post by digitsoft »

Thank you

bwolfsohn wrote:This is what i used to use (before i retired :) )

if is_this_window_open( cWindowName )
return(nil)
endif

***************************
function is_this_window_open( cWindowName )
***************************
local lRetval:=.f.,i
local oMainwindow:=SetAppwindow()
local nDeskTopWindows := Len(AppDeskTop():childList())
local nChildWindows,aChildList

// added in case oMainwindow does not have drawing area
IF !ismembervar(oMainWindow,"drawingarea")
return(lRetval)
ENDIF
nChildWindows := Len(oMainWindow:drawingarea:childList())
aChildList := oMainWindow:drawingarea:childList()


IF (nDesktopWindows >2 .OR. nChildWindows>1) .AND. !Empty(cWindowName)
FOR i := 1 TO nChildwindows
IF ismembervar(aChildList,"title")
IF aChildList:title == cWindowName
err_msg("Cannot open "+cWindowName+" twice")
SetAppFocus(aChildList)
lRetVal := .t.
EXIT
ENDIF
ENDIF
NEXT
ENDIF
return(lRetval)
Nolberto Paulino
Regards

Post Reply