TO NAGES : RESTORE STATE NOT RUN OK

TO NAGES : RESTORE STATE NOT RUN OK

Postby Silvio » Sat Feb 12, 2011 12:37 pm

Dear Nages,
I RECOMPILED MINE APPLICATION

IT use the restore state command of Xbrowse

LOCAL cState := GetPvProfString(INIBROWSE, "VdsState","", oApp():cIniFile)

...

oApp():oGrid := TXBrWin7():New( oApp():oDlg )
oApp():oGrid:nTop := 00
oApp():oGrid:nLeft := nSplit+2
oApp():oGrid:nBottom := ::nGridBottom
oApp():oGrid:nRight := ::nGridRight

all cols here


oApp():oGrid:SetRDD()
oApp():oGrid:CreateFromCode()
oApp():oGrid:nRowHeight := 21
oApp():oGrid:RestoreState( cState )


INITIAL the state was symply and all people can read it

[VDS]
sociState=40;1:50:Codice:S;2:25::S;3:360:Nome/Ragione Sociale:S;4:100:Ult Acquisto:S;5:100:Sdo. Attuale:S;6:100:Tipo:S
SociOrder=1
SociRecno=63
SociSplit=102.00


NOW the state is a string code no good for me

[VDS]
SociState=XSS:4165010500414F000200430D005265417272616E6765436F6C73413A000D004E0100314E0100324E0100334E0100344E0100354E0100364E0100374E0100384E0100394E020031304E020031314E020031324E020031334115000200430B005F6E526F774865696768744E0200353441570002004308005F6E5769647468734147000D004E020038304E020032354E03003235304E020034304E020033304E020035374E020034304E020034304E020034304E020039304E03003135304E03003230304E0300313030415F0002004307005F6C48696465734150000D004C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E413A0002004309005F63477270486472734129000D00550000550000550000550000550000550000550000550000550000550000550000550000550000
SociOrder=7
SociRecno=7
SociSplit=157.00

but it make error or I not undesrstood How it must run


here the ERROR when I reopen the archive

Code: Select all  Expand view
Application
===========
   Path and name: C:\WORK\PRG\VDSWIN\FSDI.Exe (32 bits)
   Size: 2,897,920 bytes
   Time from start: 0 hours 0 mins 7 secs
   Error occurred at: 12-02-2011, 13:29:07
   Error description: Error BASE/1068  Error de argumento: acceso al array
   Args:
     [   1] = U  
     [   2] = N   1

Stack Calls
===========
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBRWIN7:RESTORESTATE(5421)
   Called from:  => AEVAL(0)
   Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:RESTORESTATE(5421)



Variables in use


Code: Select all  Expand view
================
   Procedure     Type   Value
   ==========================
   (b)TXBRWIN7:RESTORESTATE
     Param   1:    U    
     Param   2:    N    4
     Local   1:    U    
     Local   2:    U    
     Local   3:    O    Class: TXBRWIN7
     Local   4:    U    
     Local   5:    N    1
     Local   6:    U    
     Local   7:    U    
   AEVAL
     Param   1:    A    Len:    5
     Param   2:    B    {|| ... }
   TXBRWIN7:RESTORESTATE
     Param   1:    C    "XSS:415D0605004194010200430D005265417272616E6765436F6C73417F014E004E0100314E0100324E0100334E0100344E0100354E0100364E0100374E0100384E0100394E020031304E020031314E020031324E020031334E020031344E020031354E020031364E020031374E020031384E020031394E020032304E020032314E020032324E020032334E020032344E020032354E020032364E020032374E020032384E020032394E020033304E020033314E020033324E020033334E020033344E020033354E020033364E020033374E020033384E020033394E020034304E020034314E020034324E020034334E020034344E020034354E020034364E020034374E020034384E020034394E020035304E020035314E020035324E020035334E020035344E020035354E020035364E020035374E020035384E020035394E020036304E020036314E020036324E020036334E020036344E020036354E020036364E020036374E020036384E020036394E020037304E020037314E020037324E020037334E020037344E020037354E020037364E020037374E020037384115000200430B005F6E526F774865696768744E0200323141C10102004308005F6E57696474687341B1014E004E020034374E03003238364E020037364E020037364E020033314E020034324E020037364E03003238364E03003238364E020036"
     Local   1:    O    Class: TXBRWIN7
     Local   2:    A    Len:    5
   VDS110
     Local   1:    U    
     Local   2:    U    
     Local   3:    C    "XSS:415D0605004194010200430D005265417272616E6765436F6C73417F014E004E0100314E0100324E0100334E0100344E0100354E0100364E0100374E0100384E0100394E020031304E020031314E020031324E020031334E020031344E020031354E020031364E020031374E020031384E020031394E020032304E020032314E020032324E020032334E020032344E020032354E020032364E020032374E020032384E020032394E020033304E020033314E020033324E020033334E020033344E020033354E020033364E020033374E020033384E020033394E020034304E020034314E020034324E020034334E020034344E020034354E020034364E020034374E020034384E020034394E020035304E020035314E020035324E020035334E020035344E020035354E020035364E020035374E020035384E020035394E020036304E020036314E020036324E020036334E020036344E020036354E020036364E020036374E020036384E020036394E020037304E020037314E020037324E020037334E020037344E020037354E020037364E020037374E020037384115000200430B005F6E526F774865696768744E0200323141C10102004308005F6E57696474687341B1014E004E020034374E03003238364E020037364E020037364E020033314E020034324E020037364E03003238364E03003238364E020036"
     Local   4:    N    1
     Local   5:    N    1
     Local   6:    N    102.00
     Local   7:    U    
     Local   8:    U    
     Local   9:    U    
     Local  10:    O    Class: TBRUSH
     Local  11:    A    Len:    8
     Local  12:    A    Len:   28
     Local  13:    A    Len:    8
     Local  14:    O    Class: TMENUITEM
     Local  15:    O    Class: TBTNBMP
   (b)PERFORM
   PERFORM
     Param   1:    C    "VDS110()"
     Param   2:    O    Class: TMENUITEM
     Param   3:    O    Class: TBTNBMP
     Local   1:    U    
     Local   2:    C    "VDS110"
     Local   3:    C    "Gestione anagrafica volontari      "
     Local   4:    B    {|| ... }
     Local   5:    U    
     Local   6:    C    "MODULI"
     Local   7:    C    "PERMESSI"
     Local   8:    U    
     Local   9:    U    
     Local  10:    U    
     Local  11:    U    
   (b)TAPPLICATION:BUILDBTNBAR
     Param   1:    O    Class: TBTNBMP
   TBTNBMP:CLICK
     Local   1:    O    Class: TBTNBMP
   TBTNBMP:LBUTTONUP
     Param   1:    N    34
     Param   2:    N    18
     Param   3:    O    Class: TBTNBMP
     Local   1:    U    
     Local   2:    L    .T.
   TCONTROL:HANDLEEVENT
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    2228242
     Local   1:    O    Class: TBTNBMP
     Local   2:    U    
   TBTNBMP:HANDLEEVENT
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    2228242
     Local   1:    O    Class: TBTNBMP
   _FWH
     Param   1:    N    2228242
     Param   2:    N    514
     Param   3:    N    0
     Param   4:    N    2228242
     Param   5:    N    4
     Local   1:    O    Class: TBTNBMP
   WINRUN
     Param   1:    N    1115536
   TWINDOW:ACTIVATE
     Param   1:    C    "NORMAL"
     Param   2:    U    
     Param   3:    U    
     Param   4:    U    
     Param   5:    B    {|| ... }
     Param   6:    B    {|| ... }
     Param   7:    U    
     Param   8:    B    {|| ... }
     Param   9:    U    
     Param  10:    U    
     Param  11:    U    
     Param  12:    U    
     Param  13:    U    
     Param  14:    U    
     Param  15:    U    
     Param  16:    U    
     Param  17:    B    {|| ... }
     Param  18:    U    
     Param  19:    U    
     Local   1:    O    Class: TWINDOW
     Local   2:    U    
     Local   3:    U    
   TAPPLICATION:ACTIVATE
     Local   1:    O    Class: TAPPLICATION
   MAIN
 





Can I have a solution ?

Or How I can to re- insert the old code ( restorestate and savestate) ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby nageswaragunupudi » Sat Feb 12, 2011 1:43 pm

Please make a small self contained program which I can compile and test. Please also let me know the version of FWH you are using.
If you like, please send email to me.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby Silvio » Sat Feb 12, 2011 4:25 pm

it is too hard to make..
and I have some problems because I use vtaskbar instead of explorerbar.

but i saw perhaps the error and I want say to you this suggestion:

if you not declare column and fields , xbrowse take all fields of archive dbf

for small archive it not happened, but if you try the mine archive dbf with 78 fields it make error, this when you reopen the xbrowse because it read the state

I cannot divide this achive into 2 or 3 dbf because I have it from 5 year and I have many final cstomers use this application with this archive.

With old restore it not happened or I not tried with all fields

If I declase on xbrowse 10/15 fields it run ok
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby nageswaragunupudi » Sat Feb 12, 2011 5:03 pm

I know.
The problems are more related to the way you use and not with the xbrowse logic.
If you are able to reproduce the error in independent sample, I can clearly point out for what reason it is happening.
You also do not specify alias for the browse object. This can result in unexpected behavior at times.
I can give clear advice if only you can make a sample that can reproduce the error.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby Silvio » Sat Feb 12, 2011 9:58 pm

I sent now the test

Now with another error


Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTHEADER(8713)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:PAINTHEADER(1509)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:PAINT(1292)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:DISPLAY(1195)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby Silvio » Mon Feb 14, 2011 10:43 am

this error only on Windows Seven 64 bit

but I tried also on windows seven 32 bit

When go out this error ?

When I move a column, or I try to change the size of the column, or I try to change the size of the main window !!!

Dear My Friend Nages,

Any solution ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby nageswaragunupudi » Tue Feb 15, 2011 8:36 pm

Silvio wrote:I sent now the test

Now with another error


Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTHEADER(8713)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:PAINTHEADER(1509)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:PAINT(1292)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:DISPLAY(1195)

Please make this correction in your XBrowse.Prg.

In the method PaintHeader( .. ) of TXBrwColumn, locate the expression
Code: Select all  Expand view
! ( CRLF $ cHeader )
and substitute with
Code: Select all  Expand view
! ( CRLF $ IfNil( cHeader, "" ) )

You will find this expression at two places in this method. Please correct in both the places.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby Silvio » Tue Feb 15, 2011 9:35 pm

It seems to work
but there is a problem now
when I reopen the table
it's very slowly , I must wait a second and theclass reopen the table
with very little perceptible, but this only happens for large files
with many fields as this :


Code: Select all  Expand view

 aBrowse   := { { { || AL->AlCodigo }, i18n("Codigo"), 60, 0 },;
                  { { || AL->AlTipo }, i18n("Familia"), 120, 0 },;
                  { { || AL->AlAlimento }, i18n("Ingrediente"), 120, 0 },;
                  { { || AL->AlUnidad }, i18n("Unidad"), 90, 0 },;
                  { { || TRAN( AL->AlPrecio, "@E 999,999.99" ) }, i18n("Precio"), 90, 1 },;
                  { { || DtoC( AL->AlUltCom ) }, i18n("Ult. Compra"), 120, 0 },;
                  { { || AL->AlProveed }, i18n("Proveedor"), 150, 0 },;
                  { { || TRAN( AL->AlKCal, "@E9,999,999.99" ) }, i18n("KCalorias"), 90, 1 },;
                  { { || TRAN( AL->AlProt, "@E9,999,999.99" ) }, i18n("Proteinas"), 90, 1 },;
                  { { || TRAN( AL->AlHc, "@E9,999,999.99" ) }, i18n("Hidratos"), 90, 1 },;
                  { { || TRAN( AL->AlGt, "@E9,999,999.99" ) }, i18n("Grasas totales"), 90, 1 },;
                  { { || TRAN( AL->AlGs, "@E9,999,999.99" ) }, i18n("Gr. Saturadas"), 90, 1 },;
                  { { || TRAN( AL->AlGmi, "@E9,999,999.99" ) }, i18n("Gr. Monoinsat."), 90, 1 },;
                  { { || TRAN( AL->AlGpi, "@E9,999,999.99" ) }, i18n("Gr. Poliinsat."), 90, 1 },;
                  { { || TRAN( AL->AlCol, "@E9,999,999.99" ) }, i18n("Colesterol"), 90, 1 },;
                  { { || TRAN( AL->AlProt, "@E9,999,999.99" ) }, i18n("Proteinas"), 90, 1 },;
                  { { || TRAN( AL->AlFib, "@E9,999,999.99" ) }, i18n("Fibras"), 90, 1 },;
                  { { || TRAN( AL->AlNa, "@E9,999,999.99" ) }, i18n("Sodio"), 90, 1 },;
                  { { || TRAN( AL->AlCa, "@E9,999,999.99" ) }, i18n("Calcio"), 90, 1 } }

   FOR i := 1 TO Len(aBrowse)
      oCol := oApp():oGrid:AddCol()
      oCol:bStrData := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]
      oCol:nDataStrAlign := aBrowse[ i, 4 ]
      oCol:nHeadStrAlign := aBrowse[ i, 4 ]
   NEXT
 


the same if I have a small archive with 6 columns with bitmaps, strange very strange and now I cannot see the headers of this table
look here please
Image
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby Silvio » Tue Feb 15, 2011 10:31 pm

Image

opps ...!!! I not have the headers now!!!
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby nageswaragunupudi » Tue Feb 15, 2011 11:10 pm

1. From the time XBrowse was originally written, the program expects some character value to be assigned as cHeader of every column. If not you get into some problem somewhere or other.

2. If you are using command syntax, this is automatically taken care of.

3. If you are using old syntax, the programmer has to assign cHeader with a character value manually.

4. If we do not have column headers, the menu for hide and unhide of columns does not serve any purpose to the user. In case of blank headers it is appropriate for the programmer to disable this feature.

5. If we write the code in the old style, the programmer has to assign the datas with the full knowledge of xbrowse's behavior.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby Silvio » Wed Feb 16, 2011 7:20 am

sorry Rao,
but I not understood what you write

1 . YOU proposed me to change this line ! ( CRLF $ IfNil( cHeader, "" ) ) for the error 8713
But Xbrowse NOT SHOW this error If we use the last methods :
savestate() amd resorestate()

2 . because the new method savestate() create a string
( XSS:418A010600413B000200430D005265417272616E6765436F6C7341260009004E0100314E0100324E0100334E0100344E0100354E0100364E0100374E0100384E0100394115000200430B005F6E526F774865696768744E0200323141470002004308005F6E57696474687341370009004E03003134344E020039304E03003132304E03003132304E03003132304E03003132324E03003132304E03003135304E030031353041470002004307005F6C486964657341380009004C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E412E0002004309005F6347727048647273411D000900550000550000550000550000550000550000550000550000550000416A0002004309005F634865616465727341590009004306004E6F6D627265430600432E492E462E43090044697265636369F36E4309006C6F63616C6964616443080054656C65666F6E6F43030046617843040050616973430600452D6D61696C430900536974696F20776562..)

if this string is created with two or many lines

then the new restorestate() method not read good this string and make errors on paintheader method, not shown the heade and other errors

YOu modified the savestate method but the old method was easy :

PrState=21;1:150:Nombre:S;2:90:C.I.F.:S;3:120:Dirección:S;4:120:localidad:S;5:120:Telefono:S;6:120:Fax:S;7:120:Pais:S;8:150:E-mail:S;9:23:Sitio web:S

this was easy to read

I think you must only insert information for the multiheader , often modify the save state method




3. I think you made this modifiy because you modify mine multiheader code feateure, but I thinked it with no popup show or state saved because there was problems

3. You modified my multiheader code and you modified savestate and restore methods but I think you must found another solution.

4. I use the old syntax and the new syntax, I snet you a prg with old syntax and here I insert codes lines with the new systax but the methods restorestate not read good the string XSS becaus eit is too big ( it is created with two lines into inifile)

5. it is impossible mine apps run ok on old xbrowse version and with fwh09 /fwh10 not run ok

6. If I purchase the new version , then all this run ok ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO NAGES : RESTORE STATE NOT RUN OK

Postby Silvio » Wed Feb 16, 2011 8:17 am

TRY THIS SYMPLY TEST PLEASE

http://share1t.com/vxw0k2

IT CREATE A BIG XSS STRING

[Browse]
AlState=XSS:41D3020600416D000200430D005265417272616E6765436F6C7341580013004E0100314E0100324E0100334E0100344E0100354E0100364E0100374E0100384E0100394E020031304E020031314E020031324E020031334E020031344E020031354E020031364E020031374E020031384E020031394115000200430B005F6E526F774865696768744E0200323141750002004308005F6E57696474687341650013004E020036304E03003132304E03003132304E020039304E020039304E03003132304E03003135304E020039304E020039304E020039304E020039304E020039304E020039304E020039304E020039304E020039304E020039304E020039304E0200393041830002004307005F6C486964657341740013004C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E4C03002E462E414C0002004309005F6347727048647273413B00130055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000055000041F90002004309005F634865616465727341E8001300430600436F6469676F43070046616D696C6961430B00496E6772656469656E7465430600556E6964616443060050726563696F430B00556C742E20436F6D70726143090050726F766565646F724309004B43616C6F7269617343090050726F7465696E61734308004869647261746F73430E0047726173617320746F74616C6573430D0047722E20536174757261646173430E0047722E204D6F6E6F696E7361742E430E0047722E20506F6C69696E7361742E430A00436F6C65737465726F6C43090050726F7465696E6173430600466962726173430500536F64696F43060043616C63696F
AlOrder=1
AlRecno=1


WHEN YOU REOPEN THE EXE IT MAKE ERROR ON PAINTHEADER

Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTHEADER(8713)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:PAINTHEADER(1509)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:PAINT(1292)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:DISPLAY(1195)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1459)
Called from: .\source\classes\XBROWSE.PRG => TXBRWIN7:HANDLEEVENT(11050)
Called from: .\source\classes\WINDOW.PRG => _FWH(3394)
Called from: => SYSREFRESH(0)



------------------------------------------------------------------------


THEN if i MODIFY THE METHOS PAINTHEADER OF XBROWSE

lines 8714- 8729

// nStyle := ::DefStyle( ::nHeadStrAlign, ! ( CRLF $ cHeader ) )
nStyle := ::DefStyle( ::nHeadStrAlign, ! ( CRLF $ IfNil( cHeader, "" ) ) )
nBmpNo := ::nHeadBmpNo
if ! Empty( ::cOrder )
aBitmap := ::oBrw:aSortBmp[ If( ::cOrder == 'A', 1, 2 ) ]
nBmpAlign := AL_RIGHT
elseif !Empty( aBitmap := ::aBitmap( nBmpNo ) )
nBmpAlign := ::nHeadBmpAlign
endif
else
// paint group header
nWidth := nGrpWidth
cHeader := ::cGrpHdr
nHeight := ::nGrpHeight
oFont := ::oGrpFont
// nStyle := ::DefStyle( AL_CENTER, ! ( CRLF $ cHeader ) )
nStyle := ::DefStyle( AL_CENTER, ! ( CRLF $ IfNil( cHeader, "" ) ) )




THEN WE CANNOT SEE THE HEADERS AS YOU CAN SEE IN THIS PICTURE


Image
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests