GET com array
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20416
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
GET com array
Tentei fazer GETS com array mas trava tudo.
Tem como fazer isto em hwgui?
FOR nCont = 1 TO 10
@ lin, col GET mVar[nCont]
NEXT
Tem como fazer isto em hwgui?
FOR nCont = 1 TO 10
@ lin, col GET mVar[nCont]
NEXT
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/
GET com array
TEORICAMENTE tem de funcionar.
Trava em que sentido?
Se puder postar o código todo do DIALOG
Trava em que sentido?
Se puder postar o código todo do DIALOG
Luis Fernando Basso
Desenvolvedor VFP + XHARBOUR + HWGUI
lfbasso@gmail.com
http://www.engersoft.com.br
Desenvolvedor VFP + XHARBOUR + HWGUI
lfbasso@gmail.com
http://www.engersoft.com.br
- JoséQuintas
- Administrador

- Mensagens: 20416
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
GET com array
Peguei o exemplo da hwgui e ajustei.
Aqui o código que funciona e o que não funciona.
Não funciona em hwgui significa que funciona em console.
Mas em hwgui, isso faz o programa travar e precisa ser fechado no windows.
Aqui o código que funciona e o que não funciona.
Não funciona em hwgui significa que funciona em console.
Mas em hwgui, isso faz o programa travar e precisa ser fechado no windows.
Código: Selecionar todos
// @ 20, 5 + 35 GET ee[1] PICTURE "XXXXXXXXXXXXXXX" SIZE 260, 26
// @ 20, 5 + 65 GET ee[2] PICTURE "XXXXXXXXXXXXXXX" SIZE 260, 26
// @ 20, 5 + 95 GET ee[3] PICTURE "XXXXXXXXXXXXXXX" SIZE 260, 26
// @ 20, 5 +125 GET ee[4] PICTURE "XXXXXXXXXXXXXXX" SIZE 260, 26
// @ 20, 5 +155 GET ee[5] PICTURE "XXXXXXXXXXXXXXX" SIZE 260, 26
FOR nCont = 1 TO 5
@ 20, 5 + 5 + nCont*30 GET ee[nCont] PICTURE "XXXXXXXXXXXXXXXXXXXXXX" SIZE 260,26
NEXT
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/
GET com array
Realmente deste forma não funciona .
Deste forma funciona.
Deste forma funciona.
Código: Selecionar todos
Function GetAarray
Local odlg, nCont
LOCAL oG := {,,,,}
Private Ee := Array( 5 ), cCont
Afill( eE, SPACE(20) )
Afill( oG, Nil )
INIT DIALOG oDlg TITLE "Form1" ;
AT 0, 0 SIZE 510,356 CLIPPER ;
STYLE WS_POPUP+WS_CAPTION+WS_SYSMENU+WS_SIZEBOX+DS_CENTER +WS_VSCROLL
FOR nCont := 1 TO 5
cCont := alltrim(str(ncont,2))
@ 20, 5 + 5 + nCont*30 GET oG[ nCont ] VAR &("Ee[ &cCont ]") PICTURE "XXXXXXXXXXXXXXXXXXXXXX" SIZE 260,26
NEXT
ACTIVATE DIALOG oDlg
RETURN NIL
Luis Fernando Basso
Desenvolvedor VFP + XHARBOUR + HWGUI
lfbasso@gmail.com
http://www.engersoft.com.br
Desenvolvedor VFP + XHARBOUR + HWGUI
lfbasso@gmail.com
http://www.engersoft.com.br
- JoséQuintas
- Administrador

- Mensagens: 20416
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
GET com array
Tentei definir algo pelo #command pra facilitar,
e usar um default oVar[Len(GetList)]
Mas não foi.
Assim vai complicando mas funciona:
O chato é que tudo que tem nessa linha faz parte da Getlist. Dá até a impressão que as GUIs estão no caminho errado.
Mas isso vou deixar pro bate-papo, pra não fugir do assunto deste tópico.
e usar um default oVar[Len(GetList)]
Mas não foi.
Assim vai complicando mas funciona:
Código: Selecionar todos
FOR nCont := 1 TO 5
cCont := alltrim(str(ncont,2))
@ 20, 5 + 5 + nCont*30 GET oG[ nCont ] VAR &("Ee[ &cCont ]") PICTURE "XXXXXXXXXXXXXXXXXXXXXX" SIZE &( "Len( ee[ &cCont ] ) * 13"),26
NEXTMas isso vou deixar pro bate-papo, pra não fugir do assunto deste tópico.
Editado pela última vez por anacatacombs em 26 Nov 2012 10:35, em um total de 1 vez.
Razão: Mensagem editada para colocar a tag [ code ]<br>Veja como utilizar esta tag: http://www.pctoledo.com.br/forum/faq.php?mode=bbcode#f2r1
Razão: Mensagem editada para colocar a tag [ code ]<br>Veja como utilizar esta tag: http://www.pctoledo.com.br/forum/faq.php?mode=bbcode#f2r1
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/
GET com array
simplificando um pouquinho
O problema é no indice do Array que não pode ser passado como uma simples variavel.
Código: Selecionar todos
@ 20, 5 + 5 + nCont*30 GET oG[ nCont ] VAR Ee[ &cCont ] PICTURE "XXXXXXXXXXXXXXXXXXXXXX" SIZE 260,26
Luis Fernando Basso
Desenvolvedor VFP + XHARBOUR + HWGUI
lfbasso@gmail.com
http://www.engersoft.com.br
Desenvolvedor VFP + XHARBOUR + HWGUI
lfbasso@gmail.com
http://www.engersoft.com.br
- JoséQuintas
- Administrador

- Mensagens: 20416
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
GET com array
Assim deu certo também, qualquer variável para o GET.
Valeu, já dá pra brincar um pouco.
Valeu, já dá pra brincar um pouco.
Código: Selecionar todos
FUNCTION GetAarray
LOCAL odlg, nCont, xDummy, lResult := .f.
MEMVAR Ee, cCont
PRIVATE Ee := Array( 5 ), cCont
AFill( eE, SPACE(20) )
INIT DIALOG oDlg TITLE "Form1" AT 0, 0 SIZE 510,356 CLIPPER STYLE WS_POPUP+WS_CAPTION+WS_SYSMENU+WS_SIZEBOX+DS_CENTER +WS_VSCROLL
FOR nCont := 1 TO 5
cCont := AllTrim(Str(nCont,2))
@ 20, 5 + 5 + nCont*30 GET xDummy VAR Ee[ &cCont ] PICTURE "XXXXXXXXXXXXXXXXXXXXXX" SIZE Len( ee[ &cCont ] ) * 13,26
NEXT
@ 20,250 BUTTON "Ok" SIZE 100, 32 ON CLICK {||lResult:=.T.,EndDialog()}
@ 180,250 BUTTON "Cancel" ID IDCANCEL SIZE 100, 32
ACTIVATE DIALOG oDlg
IF lResult
MsgInfo( ee[1] + chr(10) + chr(13) + ee[2] + chr(10) + chr(13) + ee[3] + chr(10) + chr(13) + ee[4] + chr(10) + chr(13) + ee[5] + chr(10) + chr(13), "Results:" )
ENDIF
RETURN NIL
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/
