// ---------------------------------------------//
function TEST
local oDlg
DEFINE DIALOG oDlg PIXEL SIZE 200,200 TITLE "Test"
@ 10, 10 BUTTON "DIALOG 1" OF oDlg PIXEL SIZE 35,15 ACTION DLG1()
@ 40, 10 BUTTON "DIALOG 2" OF oDlg PIXEL SIZE 35,15 ACTION DLG2()
ACTIVATE DIALOG oDlg CENTERED
return nil
function DLG1
local oDlg, oBrw, oDBF
USE C:\FWH\SAMPLES\CUSTOMER NEW
INDEX ON FIELD->FIRST TAG FIRST
INDEX ON FIELD->LAST TAG LAST
CLOSE CUSTOMER
oDBF := TDATABASE():Open( nil,"C:\FWH\SAMPLES\CUSTOMER", "DBFCDX" )
oDBF:SetOrder( "FIRST" )
DEFINE DIALOG oDlg PIXEL SIZE 600,495 TITLE "DLG1"
@ 0,0 XBROWSE oBrw SIZE -50,-2 PIXEL OF oDlg ;
ALIAS ( oDBF:cALIAS ) CELL LINES NOBORDER AUTOSORT AUTOCOLS ;
oBrw:CreateFromCode()
@ 10, 250 BtnBmp of oDlg RESOURCE "CLOSE16" ;
PIXEL TOP NOBORDER 2007 SIZE 35,25 ;
PROMPT "&E n d" ACTION oDlg:End()
@ 45, 250 BTNBMP OF oDlg PROMPT "First" ;
SIZE 35,25 RESOURCE "GOTOP16" PIXEL TOP NOBORDER 2007 ;
ACTION ( oDBF:GOTOP(), oBrw:Refresh(), oBrw:SetFocus() )
@ 80, 250 BTNBMP OF oDlg PROMPT "Last" ;
SIZE 35,25 RESOURCE "GOBOT16" PIXEL TOP NOBORDER 2007 ;
ACTION ( oDBF:GOBOTTOM(), oBrw:Refresh(), oBrw:SetFocus() )
ACTIVATE DIALOG oDlg CENTER
oDBF:End()
return nil
function DLG2
local oDlg, oBrw
USE C:\FWH\SAMPLES\CLIENTS NEW
INDEX ON FIELD->NAME TAG NAME
INDEX ON FIELD->ADRESS TAG ADRESS
SET TAG TO NAME
GO TOP
DEFINE DIALOG oDlg PIXEL SIZE 600,495 TITLE "DLG2"
@ 0,0 XBROWSE oBrw SIZE -5,-2 PIXEL OF oDlg ;
ALIAS ( "CLIENTS" ) CELL LINES NOBORDER AUTOSORT AUTOCOLS ;
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTER
CLOSE CLIENTS
return nil
/*
Language : Fivewin/xHarbour
Updated :
Notes : Code provided by Diego Decandia
viewtopic.php?f=3&t=34468&p=204989#p204985
*/
#include "fivewin.ch"
Function Main()
REQUEST DBFCDX
rddsetdefault( "DBFCDX" )
Test()
Return nil
// ---------------------------------------------//
function TEST
local oDlg
DEFINE DIALOG oDlg PIXEL SIZE 200,200 TITLE "Test"
@ 10, 10 BUTTON "DIALOG 1" OF oDlg PIXEL SIZE 35,15 ACTION DLG1()
@ 40, 10 BUTTON "DIALOG 2" OF oDlg PIXEL SIZE 35,15 ACTION DLG2()
ACTIVATE DIALOG oDlg CENTERED
return nil
function DLG1
local oDlg, oBrw, oDBF
USE C:\FWH\SAMPLES\CUSTOMER NEW
INDEX ON FIELD->FIRST TAG FIRST
INDEX ON FIELD->LAST TAG LAST
CLOSE CUSTOMER
oDBF := TDATA():New( nil,"C:\FWH\SAMPLES\CUSTOMER", "DBFCDX" )
oDBF:use()
msgInfo(if(oDBF:used(),"Customer.dbf is open","Customer.dbf is not open"))
//oDBF:SetOrder( "FIRST" )
DEFINE DIALOG oDlg PIXEL SIZE 600,495 TITLE "DLG1"
@ 0,0 XBROWSE oBrw SIZE -50,-2 PIXEL OF oDlg ;
ALIAS ( oDBF:cALIAS ) CELL LINES NOBORDER AUTOSORT AUTOCOLS ;
oBrw:CreateFromCode()
@ 10, 250 BtnBmp of oDlg RESOURCE "CLOSE16" ;
PIXEL TOP NOBORDER 2007 SIZE 35,25 ;
PROMPT "&E n d" ACTION oDlg:End()
@ 45, 250 BTNBMP OF oDlg PROMPT "First" ;
SIZE 35,25 RESOURCE "GOTOP16" PIXEL TOP NOBORDER 2007 ;
ACTION ( oDBF:GOTOP(), oBrw:Refresh(), oBrw:SetFocus() )
@ 80, 250 BTNBMP OF oDlg PROMPT "Last" ;
SIZE 35,25 RESOURCE "GOBOT16" PIXEL TOP NOBORDER 2007 ;
ACTION ( oDBF:GOBOTTOM(), oBrw:Refresh(), oBrw:SetFocus() )
ACTIVATE DIALOG oDlg CENTER
oDBF:End()
return nil
function DLG2
local oDlg, oBrw
USE C:\FWH\SAMPLES\CLIENTS NEW
INDEX ON FIELD->NAME TAG NAME
INDEX ON FIELD->ADRESS TAG ADRESS
//SET TAG TO NAME
GO TOP
DEFINE DIALOG oDlg PIXEL SIZE 600,495 TITLE "DLG2"
@ 0,0 XBROWSE oBrw SIZE -5,-2 PIXEL OF oDlg ;
ALIAS ( "CLIENTS" ) CELL LINES NOBORDER AUTOSORT AUTOCOLS ;
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTER
//CLOSE CLIENTS
use
return nil
You must open dialog 1, close it, open dialog 2 and, when closed, here is the error.
James Bott wrote:CLOSE CLIENTS is not valid.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 36 guests