XbpCrt() and multi READ

Auf dem Weg von Clipper, FoxPro u.ä. nach Xbase++

Moderator: Moderatoren

XbpCrt() and multi READ

Beitragvon simofranz » Mo, 10. Okt 2016 23:38

Sorry for this simple question:

is it possible to create more CRT Windows (hybrid mode), in separate threads, and design for both different GET/READ routine ?

For example:

Code: Alles auswählen
Procedure Win1
PRIVATE GetList1:={}
oCrt1          := XbpCrt():new( oParent, , aPos, 25,80)
oCrt1:create()
SetAppWindow( oCrt1 )
SetAppFocus( oCrt1 )
@ 0,0 SAY "Field1:" GET cField1
@ 1,0 SAY "Field2:" GET cField2
READ
...
...
RETURN

Procedure Win2
PRIVATE GetList2:={}
oCrt2          := XbpCrt():new( oParent, , aPos, 25,80)
oCrt2:create()
SetAppWindow( oCrt2 )
SetAppFocus( oCrt2 )
@ 0,0 SAY "Field3:" GET cField3
@ 1,0 SAY "Field4:" GET cField4
READ

...
...
RETURN
simofranz
Rookie
Rookie
 
Beiträge: 8
Registriert: Mo, 26. Sep 2016 16:11

Re: XbpCrt() and multi READ

Beitragvon AUGE_OHR » Di, 11. Okt 2016 4:26

simofranz hat geschrieben:Procedure Win1
PRIVATE GetList1:={}

Procedure Win2
PRIVATE GetList2:={}
use
Code: Alles auswählen
Procedure Win1
LOCAL GETLIST

Procedure Win2
LOCAL GETLIST
gruss by OHR
Jimmy
Benutzeravatar
AUGE_OHR
Marvin
Marvin
 
Beiträge: 10206
Registriert: Do, 16. Mär 2006 7:55
Wohnort: Hamburg

Re: XbpCrt() and multi READ

Beitragvon simofranz » Di, 11. Okt 2016 8:45

But when i perform READ into first window and READ in a second window , only the first window have a READ active.
If i change the focus to the second window the MAIN READ start in the first window.
After a confirm all GETs in the first window, the cursor continue to the second window.

The Gets are not independent.

I missing some concepts or limits about xbpCrt and GET/READ ?
simofranz
Rookie
Rookie
 
Beiträge: 8
Registriert: Mo, 26. Sep 2016 16:11

Re: XbpCrt() and multi READ

Beitragvon brandelh » Di, 11. Okt 2016 9:18

This is strange, I heared, that in seperate threads 2 GETs even with privates would be independend, but I never tried that.
Gruß
Hubert
Benutzeravatar
brandelh
Foren-Moderator
Foren-Moderator
 
Beiträge: 13328
Registriert: Mo, 23. Jan 2006 20:54
Wohnort: Germersheim

Re: XbpCrt() and multi READ

Beitragvon simofranz » Di, 11. Okt 2016 12:52

i create a small prg to understand the problem,

1) click on FIRST WINDOW pushbutton
2) write something onto Field1

3) click on SECOND WINDOW pushbutton
4) write something onto Field3

5) activate WINDOWS1
6) try to write something onto Field1 and Field2

Win the WINDOWS2 GetList; after the last enter the getlist continue to WINDOWS2 area
Dateianhänge
prova.xpj
(544 Bytes) 57-mal heruntergeladen
prova.prg
(2.78 KiB) 55-mal heruntergeladen
simofranz
Rookie
Rookie
 
Beiträge: 8
Registriert: Mo, 26. Sep 2016 16:11

Re: XbpCrt() and multi READ

Beitragvon simofranz » Di, 11. Okt 2016 23:12

I've found the problem:

oP1:activate:={||Window1()} ------> oP1:activate:={||oT:=Thread():new(), oT:Start("WINDOW1") }
oP2:activate:={||Window2()} ------> oP2:activate:={||oT:=Thread():new(), oT:Start("WINDOW2") }


Using threads, the GET/READ works correctly into any Windows in asyncronous mode.
simofranz
Rookie
Rookie
 
Beiträge: 8
Registriert: Mo, 26. Sep 2016 16:11

Re: XbpCrt() and multi READ

Beitragvon simofranz » Di, 18. Okt 2016 17:29

The problem is too BIG for my experience...

I've attached a little demo to test it:

test.zip
(2.54 KiB) 49-mal heruntergeladen


Let try to type some chars, first from Field1-Window1 then from Field2-Window2 and see what happen

many thanks for suggestions
simofranz
Rookie
Rookie
 
Beiträge: 8
Registriert: Mo, 26. Sep 2016 16:11


Zurück zu Migration

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast