XbpCrt() and multi READ

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

Moderator: Moderatoren

Antworten
simofranz
Rookie
Rookie
Beiträge: 9
Registriert: Mo, 26. Sep 2016 17:11

XbpCrt() and multi READ

Beitrag von simofranz »

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
Benutzeravatar
AUGE_OHR
Marvin
Marvin
Beiträge: 12643
Registriert: Do, 16. Mär 2006 7:55
Wohnort: Hamburg
Hat sich bedankt: 4 Mal
Danksagung erhalten: 16 Mal

Re: XbpCrt() and multi READ

Beitrag von AUGE_OHR »

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
simofranz
Rookie
Rookie
Beiträge: 9
Registriert: Mo, 26. Sep 2016 17:11

Re: XbpCrt() and multi READ

Beitrag von simofranz »

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 ?
Benutzeravatar
brandelh
Foren-Moderator
Foren-Moderator
Beiträge: 15492
Registriert: Mo, 23. Jan 2006 20:54
Wohnort: Germersheim
Hat sich bedankt: 30 Mal
Danksagung erhalten: 17 Mal
Kontaktdaten:

Re: XbpCrt() and multi READ

Beitrag von brandelh »

This is strange, I heared, that in seperate threads 2 GETs even with privates would be independend, but I never tried that.
Gruß
Hubert
simofranz
Rookie
Rookie
Beiträge: 9
Registriert: Mo, 26. Sep 2016 17:11

Re: XbpCrt() and multi READ

Beitrag von simofranz »

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) 285-mal heruntergeladen
prova.prg
(2.78 KiB) 278-mal heruntergeladen
simofranz
Rookie
Rookie
Beiträge: 9
Registriert: Mo, 26. Sep 2016 17:11

Re: XbpCrt() and multi READ

Beitrag von simofranz »

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: 9
Registriert: Mo, 26. Sep 2016 17:11

Re: XbpCrt() and multi READ

Beitrag von simofranz »

The problem is too BIG for my experience...

I've attached a little demo to test it:
test.zip
(2.54 KiB) 323-mal heruntergeladen
Let try to type some chars, first from Field1-Window1 then from Field2-Window2 and see what happen

many thanks for suggestions
maxz
Rookie
Rookie
Beiträge: 6
Registriert: Di, 20. Jul 2021 17:47
Wohnort: Turin - ITALY

Re: XbpCrt() and multi READ

Beitrag von maxz »

no one has managed to solve this problem ?
it seems impossible to create a multi-window program in hybrid mode

there are no other alternatives than switching to the native GUI mode ?
Benutzeravatar
Marcus Herz
Rekursionen-Architekt
Rekursionen-Architekt
Beiträge: 465
Registriert: Mo, 16. Jan 2006 8:13
Wohnort: Allgäu
Hat sich bedankt: 17 Mal
Danksagung erhalten: 71 Mal
Kontaktdaten:

Re: XbpCrt() and multi READ

Beitrag von Marcus Herz »

I didn't go into the problem, but I remember from CLipper times you have to declare the getlist as privat .
If yo don't, you 're using the same which results in the mismacth you describe.

Add, try:

Code: Alles auswählen

private getlist
Gruß Marcus

Es gibt keine Grenzen, aber du kannst welche ziehen.
Benutzeravatar
AUGE_OHR
Marvin
Marvin
Beiträge: 12643
Registriert: Do, 16. Mär 2006 7:55
Wohnort: Hamburg
Hat sich bedankt: 4 Mal
Danksagung erhalten: 16 Mal

Re: XbpCrt() and multi READ

Beitrag von AUGE_OHR »

hi,
maxz hat geschrieben: Do, 09. Sep 2021 18:30 no one has managed to solve this problem ?
it seems impossible to create a multi-window program in hybrid mode

there ist no Problem ... only BAD Design

Problem for Cl*pper User to get into Windows GUI is there Way of "think" in "DOS" where you tell User to go "that Way"
User must open 1st Windows to get into 2nd Window ... but what if User want to go into 3rd Window ?

under Windows GUI there are "many Ways" and Programmer have to "react" on what User (want to) do.

---

to "learn" Xbase++ GUI i recommend to use XppFD.EXE which is the Form-Designer of Xbase++
when finish Dialog you have to add Method for "Action"

if you understand how it work than you are on right GUI Way with Xbase++

---
maxz hat geschrieben: Do, 09. Sep 2021 18:30 there are no other alternatives than switching to the native GUI mode ?
there are many Xbase - Dialect like FoxPro, Flagship and harbour Contribution which work with native Win32 Windows Controls

try harbour HMG Constribution ( open SSource )
download Full-Packet include "C"-Compiler/Linker, IDE, 2-Way Form-Designer and about 500 "working" Sample
http://www.hmgforum.com/app.php/downloa ... 4345e315e8
gruss by OHR
Jimmy
maxz
Rookie
Rookie
Beiträge: 6
Registriert: Di, 20. Jul 2021 17:47
Wohnort: Turin - ITALY

Re: XbpCrt() and multi READ

Beitrag von maxz »

you are absolutely right.

but in the presence of an old-style application with menus that launch sub-programs I would have liked to open an independent window that manages the keyboard correctly. I don't have time to redesign the whole application unfortunately
so I thought of inventing a main program that ran threads or other to open the various windows that correspond to the user's choices (Menu 1.1, 1.2, 1.3 etc.)

is this a limitation of the hybrid or text mode of xbase, correct?


max
Benutzeravatar
AUGE_OHR
Marvin
Marvin
Beiträge: 12643
Registriert: Do, 16. Mär 2006 7:55
Wohnort: Hamburg
Hat sich bedankt: 4 Mal
Danksagung erhalten: 16 Mal

Re: XbpCrt() and multi READ

Beitrag von AUGE_OHR »

hi,
maxz hat geschrieben: Do, 16. Sep 2021 16:58
is this a limitation of the hybrid or text mode of xbase, correct?
it is not impossible to use Hybrid-Mode with multi Thread but it make much more work

in Hybrid-Mode a "new" Window is like a other App so you have to switch AppWindow() and AppFocus()
only "active" Window can do "output" to Screen ... else it will crash

when use a Thread you get a new "Workspace" so you need to open DBF (again)
it will not "Sync" DBF so RECNO() can be different in Threads
like in Network you have to "Lock / Unlock" Record when open DBF multi times

---

if you don´t want to change your Source, to get 32 App, i recommend VIO ( Console ) Mode
that work like Cl*pper and is done in some Minutes ( when not use 3-PP DOS LIBs )

but do you want to BUY Xbase++ just to get 32 App ... it can be done with harbour for free
like Xbase++ most of harbour will work with Cl*pper Source and you can use GUI too

---

i have work 20 Year with Cl*pper and 20 Year with Xbase++ before start with harbour 2019.
after 100 Days i was able to create my 1st harbour GUI App but after 2 Years i still feel as Newbie

so if you want to write a Windows App forget all of your Cl*pper Source which make In-/Output.
only Source which make no In-/Output can be used for GUI

you have to Re-Design your Source for Windows to work with Events that Windows send ... that is the Way to GUI
gruss by OHR
Jimmy
maxz
Rookie
Rookie
Beiträge: 6
Registriert: Di, 20. Jul 2021 17:47
Wohnort: Turin - ITALY

Re: XbpCrt() and multi READ

Beitrag von maxz »

I don't think changing the development environment from xbase to harbour is the best choice for me.

i use xbase since year 2K, together with various libraries, such as generating reports, sending emails and connecting with some web services for electronic invoicing.

if I think about how many bugsI had to discover in my applications during a record block, using databases on the local network, on network servers and in terminal mode, then I get scared to switch to another development environment

the only way - as you suggest - is to think about rewriting everything in GUI mode

first of all, buy the new version of xbase so that I could use an editor to draw the new windows instead of my usual rows / columns (in those years I built an editor that drew everything in text mode and saved or loaded the full screen of symbols and colors).

finally, rewrite everything #-o
Benutzeravatar
AUGE_OHR
Marvin
Marvin
Beiträge: 12643
Registriert: Do, 16. Mär 2006 7:55
Wohnort: Hamburg
Hat sich bedankt: 4 Mal
Danksagung erhalten: 16 Mal

Re: XbpCrt() and multi READ

Beitrag von AUGE_OHR »

hi,
maxz hat geschrieben: Fr, 17. Sep 2021 18:09 i use xbase since year 2K, together with various libraries, such as generating reports, sending emails and connecting with some web services for electronic invoicing.
i did not know that you already have a Xbase++ Licence ... thought you begin to explore xBase Windows World

there ist a 3-PP LIB called Express++ from Roger Donnay for Xbase++ which can help you a lot.
Roger have a own Website http://bb.donnay-software.com/donnay/phpbb3/index.php
you can get a Licence for low price with all Source and Sample
gruss by OHR
Jimmy
maxz
Rookie
Rookie
Beiträge: 6
Registriert: Di, 20. Jul 2021 17:47
Wohnort: Turin - ITALY

Re: XbpCrt() and multi READ

Beitrag von maxz »

I am currently already using Express or Topdown
unfortunately there are too many limitations to use these libraries such as browse on DB p drop-down functions, bad scrolling using mouse wheel, etc.

my version of xbase is 1.9
Benutzeravatar
Marcus Herz
Rekursionen-Architekt
Rekursionen-Architekt
Beiträge: 465
Registriert: Mo, 16. Jan 2006 8:13
Wohnort: Allgäu
Hat sich bedankt: 17 Mal
Danksagung erhalten: 71 Mal
Kontaktdaten:

Re: XbpCrt() and multi READ

Beitrag von Marcus Herz »

You might also have look at XClass++. There are also samples how ro use the formdesigner....
Gruß Marcus

Es gibt keine Grenzen, aber du kannst welche ziehen.
Antworten