Hello Roger
In Express there is a function that does not let me load a screen more than one
function that does not let me load a screen more than once
function that does not let me load a screen more than once
Nolberto Paulino
Regards
Regards
Re: function that does not let me load a screen more than on
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)

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
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
Re: function that does not let me load a screen more than on
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
Regards