1. When oWnd:end executes, it crashes with an error: Error/BASE 1004 Class 'NIL' has no exported method: END
- Code: Select all Expand view
- STATIC oWnd
PROCEDURE Main (cSales)
LOCAL oIcon, oWindow, oBitMap, oBru, oMenu, nChoice, nI, nIndex, cOption, ;
cOpts
* environment
SETCANCEL(.F.)
SET _3DLOOK ON
SET CENTURY ON
SET CONFIRM OFF
SET DELETED ON
SET EPOCH TO 2000
SET ESCAPE ON
SET WRAP ON
// RDDSETDEFAULT("DBFCDX")
request SIX
rddRegister( "SIX", 1 )
rddsetdefault( "SIX" )
SET FILETYPE TO CDX
DEFINE BRUSH oBru DISK "logobmp.bmp"
DEFINE ICON oIcon DISK "logobmp.bmp"
DEFINE WINDOW oWindow FROM 13,45 TO 51,169 ;
TITLE "Sample Window";
BRUSH oBru MENU MainMenu (@oWindow, @oMenu, @nChoice) ;
ICON oIcon
SET MESSAGE OF oWindow TO "Oprima Alt-Letra Subrayada" CLOCK DATE KEYBOARD
DEFINE BITMAP oBitMap DISK "logobmp.bmp" OF oWindow
oWnd := oWindow
oWindow:Center()
ACTIVATE WINDOW oWindow
CLOSE DATABASES
RETURN
STATIC PROCEDURE MainMenu (oWindow, oMenu, nChoice)
SETKEY(ASC("X"), {|| IIF( GetKeyState( ACC_ALT ), EVAL({|| IIF(ALERT( ;
"¿ Terminar Si/No ?", {"Si", "No"}, "Salir del Programa", 2) == 1, ;
oWindow:End(), NIL)}), NIL)})
MENU oMenu
MENUITEM "&File" MESSAGE "Utilidades sobre archivos, Terminar"
MENU
MENUITEM "&Salir Alt-X" ;
ACTION IIF(ALERT("¿ Terminar Si/No ?", {"Si", "No"}, ;
"Salir del Programa", 2) == 1, oWindow:End(), NIL);
MESSAGE "Salir del programa"
ENDMENU
MENUITEM "&Mantenimiento" MESSAGE "Datos sobre Clientes"
MENU
MENUITEM "&Sample" MESSAGE "Mantenimiento a Inventario" ;
ACTION Mant(@oWindow)
MENUITEM "&Records" MESSAGE "Ver La Base De Datos" ;
ACTION DispRecs()
ENDMENU
ENDMENU
RETURN
* EOP: MainMenu
Thank you guys.