Criei o browse mas não é para o arquivo em uso.
Como defino o ALIAS a ser usado no browse ?
Como definir o ALIAS do browse ?
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20415
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
Como definir o ALIAS do browse ?
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 8028
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 2 vezes
- Curtiram: 1 vez
Como definir o ALIAS do browse ?
Olá!
Saudações,
Itamar M. Lins Jr.
Código: Selecionar todos
local oDlg, oBrwCab, oBrwItens, ...
INIT DIALOG ...
...
dbSelectArea('master') //Cabeçalho
@ 5,80 Browse oBrwCab DataBase of oDlg...
oBrwCab:Alias := "master"
...
//Browse dos itens
dbSelectArea('slave')
@ 5,35 Browse oBrwItens DataBase of oTab Size 730,400 Font oBrwFont Style WS_VSCROLL + WS_HSCROLL
oBrwItens:Alias := 'slave'
...
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20415
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
Como definir o ALIAS do browse ?
Neste instante cheguei nos fontes do hbrowse, mas valeu mesmo assim.
Pra complementar:
Esse método é chamado no New() e tem isto
Com base nessa parte, ou cria o browse com a área já selecionada, ou define depois.
Algo como:
No meu uso, foi só mover o SELECT pra depois da montagem do browse, não pode ser antes.
Como de qualquer jeito faço isso pro SET SCOPE, nem vou mexer no ::Alias
Mas valeu, pode ser útil em outros casos, ou se alterar o SET SCOPE pra forma de função e não alterar área em uso.
Pra complementar:
Código: Selecionar todos
IF ::type == BRW_DATABASE
::alias := Alias()
::bSkip := { |o, n| (o), ( ::alias ) -> ( dbSkip( n ) ) }
::bGoTop := { || ( ::alias ) -> ( DBGOTOP() ) }
::bGoBot := { || ( ::alias ) -> ( dbGoBottom() ) }
::bEof := { || ( ::alias ) -> ( Eof() ) }
::bBof := { || ( ::alias ) -> ( Bof() ) }
::bRcou := { || ( ::alias ) -> ( RecCount() ) }
::bRecnoLog := ::bRecno := { ||( ::alias ) -> ( RecNo() ) }
::bGoTo := { |o, n|(o), ( ::alias ) -> ( dbGoto( n ) ) }
Código: Selecionar todos
::alias := Alias()
Algo como:
Código: Selecionar todos
// cria label, textbox, etc
SELECT outro
// cria o browse
SELECT volta
// cria mais coisas
Como de qualquer jeito faço isso pro SET SCOPE, nem vou mexer no ::Alias
Mas valeu, pode ser útil em outros casos, ou se alterar o SET SCOPE pra forma de função e não alterar área em uso.
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20415
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
Como definir o ALIAS do browse ?
Uia, melhor ainda, no browse genérico
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/