Grid events problem

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Georg_BA
Posts: 22
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Grid events problem

Post by Georg_BA » Tue May 16, 2017 1:46 pm

Good day
I am a new member of the forum and I would like to help with the EVENTS function

I created the Win_1, in Grid_1, the "s_skl001" database is opened
I've created a new Win_3 window with a new Grid_3, opening a new database "fa_ve"
If you call the above functions, an error occurs

In WIn 7, 32 bit, I used it

MessageBoxTimeout ( 'Wait a moment' , '' , 1 , 100 )

sled_vel(aa,bb,cc,dd,ee) //b_velx.prg

in W7 =>OK,
in XP SP2 =>OK,
in XP SP3 problem

The Win_3 window opens, the Grid appears
and after 1-2 seconds this error will occur

NAZOV_M is a database field
Which I display as a detail outside the grid

I'm definitely doing some mistake and I do not need a function MessageBoxTimeout

I tried
DISABLE EVENT OF win_1
SetProperty ( "Win_1", "Grid_1" , "Enabled", .F. )
Win_1.control_100.setfocus
DoMethod("WIN_1","Control_100","SetFocus")
DisableWindow(Win_1.HANDLE)

But the result is still the same

Thanks for help

Date:16.05.2017 Time: 14:24:34
Error BASE/1003 Variable does not exist: NAZOV_M

Called from GETFILEDDATA(2910)
Called from GETDATAGRIDCELLDATA(2889)
Called from EVENTS(3060)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5717)
Called from ZOB_VEL(236)
Called from SLED_VEL(90)
Called from SLED_VELX(2376)
Called from (b)TVORBA_CIEN(132)
Called from _DOCONTROLEVENTPROCEDURE(6056)
Called from EVENTS(1763)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5717)
Called from TVORBA_CIEN(890)
Called from MAIN(150)

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Tue May 16, 2017 1:55 pm

Hi Georg,

Have you welcome to our community. :)

You mentioned different behaviour from SO, what is very strange and hard to understand.

This related error is nothing with EVENTS. All seems it's the DBF is not open or not properly used at ZOB_VEL line 236.

It quite imposible to help with more efficiency without code. May you prepare a shortest sample of you same case ?

DISABLE EVENT is not the right way. Certainly.

You have mentioned you have open DBF. But have you done previously to open the GRID ?

In somewhere NAZOV_M it's closing... :|

Another tip is to use MsgDebug(<varaible_name_or_array_or_filed_name>) instead of MessageBoxTimeout.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Tue May 16, 2017 2:06 pm

Probably due SELECT work area ??

This is Harbour and here is syntax and example:
https://vivaclipper.wordpress.com/tag/select/

Sorry if it's seems basic concept in my dedutions, but without code It's hard to guess... :?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Georg_BA
Posts: 22
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Post by Georg_BA » Wed May 17, 2017 11:58 am

Sending source + data
I tried to replace Select 1, Use xx with Use xx alias xxy, select xxy
The result was the color in Grid :o

Where is the error?
Select button "Pohyb", lose color W7-32, W-XP
after returning it for Grid_1

Select button "Farby", Win7 -OK
W XP SP3 error

Thanks for help
Attachments
asklad2.zip
Source + data
(2.61 MiB) Downloaded 30 times

User avatar
andyglezl
Posts: 859
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 7 times
Been thanked: 25 times
Contact:

Post by andyglezl » Wed May 17, 2017 2:46 pm

Porque no abres todas tus DB's al inicio y le pones un alias (en vez de manejarlos con números), yo lo hago con 40+- DB's ?
y solo seleccionas DbSelectArea("DB") cuando la necesites.
Me imagino que esta programación viene de Clipper (quizá me equivoco)
-----------------------------------------------------------------------------------------------
Why do not you open all your DB's at the beginning and you put an alias (instead of handling them with numbers), I do it with 40 + - DB's?
And only select DbSelectArea ("DB") when you need it.
I guess this programming comes from Clipper (maybe I'm wrong)
Andrés González López
Desde Guadalajara, Jalisco. México.

Georg_BA
Posts: 22
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Post by Georg_BA » Wed May 17, 2017 4:35 pm

You have estimated it exactly.
I crawl the application from clipper to x base. There are multiple modules. I use the blinker and without problems I start the modules that are transformed into x base
When I get it :)

Georg_BA
Posts: 22
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Post by Georg_BA » Wed May 17, 2017 4:37 pm

I will try to do it according to your advice, I have used this solution for my memory

User avatar
serge_girard
Posts: 1907
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 319 times
Been thanked: 74 times
Contact:

Post by serge_girard » Wed May 17, 2017 5:22 pm

Georg,

Try also reindexing: Error DBFNSX/1012 Corruption detected: s_skl02.nsx !

Serge

Georg_BA
Posts: 22
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Post by Georg_BA » Wed May 17, 2017 5:30 pm

Thank you for your help
Reindexing is not a problem, I made a demo and it is possible that I did not do reindex after the last one

Georg_BA
Posts: 22
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Post by Georg_BA » Thu May 18, 2017 8:35 am

The problem is that my function 'Aktualne'
But I do not know how to pause them when going to a new window

Date:17.05.2017 Time: 11:41:47
Error BASE/1003 Variable does not exist: SE

Called from AKTUALNEA(1630)
Called from AKTUALNE(1609)
Called from (b)TVORBA_CIEN(36)
Called from _DOWINDOWEVENTPROCEDURE(6091)
Called from EVENTS(924)
Called from SHOWWINDOW(0)
Called from _ACTIVATEWINDOW(5700)
Called from VYST_KARTA(98)
Called from VYST_KAX(2314)
Called from (b)TVORBA_CIEN(153)
Called from _DOCONTROLEVENTPROCEDURE(6056)
Called from EVENTS(1763)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5717)
Called from TVORBA_CIEN(891)
Called from MAIN(150)

Post Reply