Thanks for quick responce I will try dbcloseall()
I have an exact procedure that does not do this. the only difference in the problem file I go to another browse procedure and back,
but I use this same action throughout program.
Franco
grid problem
Moderator: Rathinagiri
Re: grid problem
All The Best,
Franco
Canada
Franco
Canada
Re: grid problem
Here is a sample of crash.
if button has focus when X out no crash.
if grid has focus on X out Crash. I think the problem is with closing temp file.
Franco
if button has focus when X out no crash.
if grid has focus on X out Crash. I think the problem is with closing temp file.
Code: Select all
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 800 ;
HEIGHT 600 ;
TITLE 'Hello World!' ;
MAIN
DEFINE BUTTON BUTTON_1
ROW 10
COL 151
CAPTION "Click for Grid 3"
ACTION GT()
WIDTH 141
HEIGHT 20
END BUTTON
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
FUNCTION GT()
FILS()
set century on
set deleted on
IF .NOT. ISWINDOWACTIVE(FORM_2)
DEFINE WINDOW Form_2 ;
AT 110, 10 ;
WIDTH 1250 ;
HEIGHT 700 ;
TITLE 'Sales Report Screen' ;
MODAL ;
NOSIZE ;
ON RELEASE {||{Closer2fils()}}
DEFINE GRID Grid_2
ROW 200
COL 30 //140
WIDTH 1190 //1100
HEIGHT 200 //370
BACKCOLOR { 180, 180, 200}
FONTCOLOR { 0, 0, 0 }
HEADERS {"Invoice", "Date" ,"Sellprice"}
WIDTHS {80, 95, 100 }
JUSTIFY {0,0,1,}
COLUMNWHEN { { || .F. },{ || .F. }, { || .F. }}
ROWSOURCE 'temp5' //"pinv_it"
COLUMNFIELDS { 'inv_NO' , 'SAL_DAT','UNIT_PRICE'}
VALUE {1,1}
TABSTOP .F.
****************************************************************************
END GRID
DEFINE BUTTON Button_1
ROW 110
COL 135
WIDTH 100
HEIGHT 25
CAPTION 'No Crash'
*ACTION Form_2.RELEASE}}
END BUTTON
DEFINE Label Label_1
ROW 80
COL 135
WIDTH 600
HEIGHT 25
VALUE 'When grid has focus on X out Crash ** When Button has focus NO CRASH'
END Label
END WINDOW
Form_2.Activate
ELSE
MSGINFO('ALREADY IN USE')
ENDIF
RETURN //NIL
*********************************************************
Function Fils
Local CF1 := {}
CF1 := {}
aADD(CF1,{'INV_no' , 'C' , 8,0})
AADD(CF1,{'ITEM_NO', 'C' , 15,0})
Aadd(CF1,{'DESC', 'C', 26,0})
Aadd(CF1,{'QTY', 'N' , 7, 2})
Aadd(CF1,{'COST' , 'N' , 11,2})
Aadd(CF1,{'UNIT_PRICE', 'N' , 11,2})
Aadd(CF1,{'CORE' , 'N' , 8,2})
Aadd(CF1,{'LIST', 'N' , 11,2})
Aadd(CF1,{'TAX1' , 'N' , 8,2})
Aadd(CF1,{'TAX2', 'N' , 8,2})
Aadd(CF1,{'GROUP' , 'C' , 15,0})
Aadd(CF1,{'PRODUCT', 'C' , 7,0})
Aadd(CF1,{'ITEM' , 'C' , 15,0})
Aadd(CF1,{'NAME' , 'C' , 25,0})
Aadd(CF1,{'PO_NUM', 'C' , 140,0})
AADD(CF1,{'ATTN2', 'C' , 20,0})
Aadd(CF1,{'SAL_PER', 'C' , 7,0})
Aadd(CF1,{'TX1', 'N' , 8,2})
Aadd(CF1,{'TX2', 'N' , 8,2})
Aadd(CF1,{'PAYMENT' , 'C' , 30,0})
Aadd(CF1,{'CUSTID' , 'C' , 7,0})
Aadd(CF1,{'SAL_DAT', 'D' , 8,0})
Aadd(CF1, {'TOTAL', 'N', 12,2})
Aadd(CF1, {'PROFIT', 'N', 12,2})
Aadd(CF1, {'PROFIT1', 'C', 12,0})
Aadd(CF1, {'Tax1Total', 'N', 10,2})
Aadd(CF1, {'Tax2Total', 'N', 10,2})
Aadd(CF1, {'POSTING' , 'C' , 6,0})
if ! hb_dbcreatetemp("temp5", cf1)
msgbox("Cannot create temporary table: Item")
RELEASE WINDOW ALL
return nil
endif
if select("temp5") = 0
use temp5 new
endif
select temp5
index on inv_no to temp5
temp := 1
do while temp < 51
append blank
replace inv_no with 'IN'+alltrim(str(temp+1000))
replace item_no with 'IT'+alltrim(str(temp+100))
replace unit_price with temp*100
temp:=temp+1
loop
enddo
return
Function CloseR2fils
close temp5
release temp5
return
All The Best,
Franco
Canada
Franco
Canada
Re: grid problem
Franco
With HMG 3.4.4 all works properly.
With HMG 3.4.4 all works properly.
Re: grid problem
Thanks kdj, I guess it`s time to change from 3.2
Do you have any programs using 3.44 in clients business`s.
I am a little nervous as I see some 3.4 problems on forum, but I guess this is a 3.2 problem and no reason to fix.
As previously suggested it is time to change.
Thanks again, Franco
Do you have any programs using 3.44 in clients business`s.
I am a little nervous as I see some 3.4 problems on forum, but I guess this is a 3.2 problem and no reason to fix.
As previously suggested it is time to change.
Thanks again, Franco
All The Best,
Franco
Canada
Franco
Canada
Re: grid problem
I downloaded and installed 3.44 on a windows 10 laptop. I run 3.2 on a windows 8.1 laptop.
I had to change a couple of things in program but so far runs good.
In 3.2 my program size is 3753k
In 3.4.4 my program size is 4984k and takes 20 seconds longer to compile .... Is this normal.
Franco
I had to change a couple of things in program but so far runs good.
In 3.2 my program size is 3753k
In 3.4.4 my program size is 4984k and takes 20 seconds longer to compile .... Is this normal.
Franco
All The Best,
Franco
Canada
Franco
Canada