--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/136e6f4f-077c-414e-8c54-f6bc6268f5c5n%40googlegroups.com.
For every new GET-READ part, make Getlist as LOCAL Getlist:={}.
I assume that each new GET-READ part is in separate function.
In this way GET variables in one GET-READ part is independent from GET variables in other GET-READ part.
Regards,
Simo.PROCEDURE Main
LOCAL a, b, c, d
LOCAL GetList := {}
a := b := c := d := Space(20)
SetMode(25,80)
CLS
@ 1, 0 GET a VALID OtherGet( @c, @d )
@ 2, 0 GET b VALID OtherGet( @c, @d )
READ
RETURN
FUNCTION OtherGet( a, b )
LOCAL GetList := {}
SAVE SCREEN
@ 5, 0 GET a
@ 6, 0 GET b
READ
RESTORE SCREEN
RETURN .T.
José M. C. Quintas
--
Hi.
In usual way of programming you do not need to make any changes in Getsys.prg.
May be only if your application have some special requests regarding GETs, but it is very rare.
So it would be very helpful to explain us your situation with some small part of your PRG.
Regards,
Simo.Hi Med.
I am not sure that I understand correctly what you mean with get:name.
I will try with this. Sorry if I write something that you already know or is irrelevant to your problem. The purpose of this is to be more close on what you want to solve.
If you have for example FILE1 and its field Item C10 you can write:
DO WHILE .T.
@ 10,10 GET FILE1->Item
READ
IF LASTKEY()==27
EXIT
ENDIF
ENDDO
But if you place alias name in memvar say malias, you can also write this:
malias:="FILE1"
DO WHILE .T.
@ 10,10 GET (malias)->Item
READ
IF LASTKEY()==27
EXIT
ENDIF
* here you can put another alias (workarea) with malias:="File2", etc.
ENDDO
Changing value of memvar malias you can edit file by your wish (in different workareas). No need to change anything in Getsys.prg .
Requirement is that files must have same structure.
Regards,
Simo.Why to do this ?
Where do you will use the alias ?
It is wrong to use field on get, this will require file locked during all get time.
Wrong to think on getsys to change alias.
What do you want to do ?
A single sample using 3 workareas
SELECT voucher
@ 1, 0 GET nCode VALID client->( SeekNumber( nCode ) )
@ 2, 0 GET nCode2 VALID product->( SeekNumber( nCode2 ) )
READ
FUNCTION SeekNumber( nCode )
SEEK nCode
RETURN ! Eof()
José M. C. Quintas
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/59d9f2fb-60be-45ef-8c85-ecbce8cf2567n%40googlegroups.com.
Not sure what means "same input screen".
Is it anything like this?
#include "inkey.ch"
#include "dbstruct.ch"
PROCEDURE Main
LOCAL GetList := {}
LOCAL nKey, nCont, cName, cField, aStru
SetMode(33,100)
CLS
USE jpreguso
aStru := dbStruct()
DO WHILE .T.
FOR nCont = 1 TO Len( aStru )
cName := aStru[ nCont, DBS_NAME ]
FOR EACH cField IN { cName }
IF nCont > 21
EXIT
ENDIF
@ nCont , 0 SAY cField GET &cField
IF nCont > 21
EXIT
ENDIF
NEXT
IF nCont > 21
EXIT
ENDIF
NEXT
CLEAR GETs
@ 23, 0 SAY "PgUp, PgDn, Home, End, ESC"
nKey := Inkey(0)
DO CASE
CASE nKey == K_PGUP ; dbSkip()
CASE nKey == K_PGDN ; dbSkip(-1)
CASE nKey == K_HOME ; dbGoTop()
CASE nKey == K_END ; dbGoBottom()
CASE nKey == K_ESC ; EXIT
OTHERWISE; LOOP
ENDCASE
ENDDO
CLOSE DATABASES
RETURN
José M. C. Quintas
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/0631d1a9-99c2-4ee2-9507-3c1378e63939n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/0631d1a9-99c2-4ee2-9507-3c1378e63939n%40googlegroups.com.
#include "inkey.ch"
#include "dbstruct.ch"
PROCEDURE Main
LOCAL nKey, nSelect1, nSelect2
SET EXCLUSIVE OFF
SetMode(33,100)
SET COLOR TO W/B,N/W,,,W/BR
CLS
use jpreguso ALIAS one new
nSelect1 := Select()
use jpreguso ALIAS two new
nSelect2 := Select()
DO WHILE .T.
Show( 0, nSelect1, .F. )
Show( 40, nSelect2,.F. )
@ 23, 0 SAY "PgUp, PgDn, Home, End, A_EditA, B_EditB, ESC"
nKey := Inkey(0)
DO CASE
CASE nKey == K_PGUP ; ( nSelect1 )->( dbSkip(-1) ); (
nselect2 )->( dbSkip(-1) )
CASE nKey == K_PGDN ; ( nSelect1 )->( dbSkip() ); (
nSelect2 )->( dbSkip() )
CASE nKey == K_HOME ; ( nselect1 )->(dbGoTop() ); (
nSelect2 )->( dbGoTop() )
CASE nKey == K_END ; ( nSelect1 )->( dbGoBottom() ); (
nSelect2 )->( dbGoBottom() )
CASE Upper( Chr( nKey ) ) == "A"; Show( 0, nSelect1, .T. )
CASE Upper( Chr( nKey ) ) == "B"; Show( 40, nSelect2, .T. )
CASE nKey == K_ESC ; EXIT
ENDCASE
ENDDO
CLOSE DATABASES
RETURN
FUNCTION Show( nCol, nAlias, lEdit )
LOCAL nCont, cName, cField, aStru, GetList := {}
SELECT ( nAlias )
aStru := dbStruct()
FOR nCont = 1 TO Len( aStru )
IF nCont > 21
EXIT
ENDIF
cName := aStru[ nCont, DBS_NAME ]
FOR EACH cField IN { cName }
@ nCont, nCol SAY cField GET &cField
NEXT
NEXT
IF lEdit
rLock()
READ
ELSE
CLEAR GETS
ENDIF
RETURN Nil
José M. C. Quintas
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/2a24f594-aa1c-4126-917d-96ce2c35ff0fn%40googlegroups.com.
It is a sample only.
Another way is to use multithread and more than one window.
Check available GTs for multithread.
Same sample using multithread.
Change to existing DBF
hbmk2 test.prg -mt -gui
#include "inkey.ch"
#include "dbstruct.ch"
#include "hbgtinfo.ch"
PROCEDURE Main
LOCAL lMainVisible := .T.
IF lMainVisible
SetMode(25,80)
CLS
ENDIF
hb_ThreadStart( { || Main2() } )
hb_ThreadStart( { || Main2() } )
IF lMainVisible
? "hit a key to close all"
Inkey(0)
ELSE
hb_ThreadWaitForAll()
ENDIF
RETURN
PROCEDURE Main2
LOCAL nKey, nSelect1, nSelect2
hb_gtReload( hb_gtInfo( HB_GTI_VERSION ) )
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/5b47c87e-3650-4a1e-95d6-03e3c021d98en%40googlegroups.com.
It would be helpful if you inform us how did you implemented
your solution. May be someone can have same situation as you.
Regards,
Simo.Yes getlist contains all objects.
You can't change the object from one alias to another.
Use variables and you are free to load/save on any dbf.
button1: load from dbf 1 to variables and edit
button2: load from dbf2 to variables and edit
button3: save to dbf1
button4: save to dbf2
José M. C. Quintas
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/e6a4f85e-b20e-40c8-9304-4fa457f301d0n%40googlegroups.com.