Tengo un problema, pretendo en forma simple cargar 2 Combobox con Array, seleccionando en el primero un elemento, vaya a cargar el 2 Array, cada Array tiene Codigo y Descripcion.
El segundo se carga correctamente con los datos en la funcion Carga_Comuna, pero al volver no muestra los datos en el 2 combobox y arroja error.
Ademas, trato de hacer busqueda incremental y solo permite digiar la primera letra.
Dejo Error y Codigo.
Muchos saludos
Antonio
Error:
- Code: Select all Expand view RUN
Compiler version: Harbour 3.2.0dev (r2008190002)
FiveWin version: FWH 22.03
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 5.1, Build 2600 Service Pack 3
Time from start: 0 hours 0 mins 19 secs
Error occurred at: 12/08/2022, 09:45:22
Error description: Error BASE/1132 Error de rango: acceso al array
Args:
[ 1] = A {0,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,315,316,317,318,319 ... } length: 33
[ 2] = N 0
Stack Calls
===========
Called from: .\Actu_Ficha_Gene.PRG => (b)ACTUA_FICHA_GRAL( 172 )
Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:CHANGE( 581 )
Called from: .\source\classes\COMBOBOX.PRG => (b)TCOMBOBOX( 160 )
Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:RESET( 0 )
Called from: .\source\classes\COMBOBOX.PRG => (b)TCOMBOBOX( 173 )
Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:SETITEMS( 0 )
Called from: .\Actu_Ficha_Gene.PRG => (b)ACTUA_FICHA_GRAL( 167 )
Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:CHANGE( 581 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1824 )
Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:HANDLEEVENT( 923 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3560 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 453 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1140 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: .\Actu_Ficha_Gene.PRG => ACTUA_FICHA_GRAL( 232 )
Called from: .\Estetica.PRG => (b)MENU( 281 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1563 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1141 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3560 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1097 )
Called from: .\Estetica.PRG => MAIN( 229 )
System
======
CPU type: Pentium(R) Dual-Core CPU E6600 @ 3.06GHz 3058 Mhz
Hardware memory: 2010 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 10
1 ,
2 , C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202
3 , C:\WINDOWS\system32\COMCTL32.DLL
4 , C:\WINDOWS\system32\SHLWAPI.dll
5 , E:\desa\Estetica\Estetica.exe
6 DDE Server Window, C:\WINDOWS\system32\OLE32.DLL
7 GDI+ Window, C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.6002.23084_x-ww_f3f35550\GDIPLU
8 M, C:\WINDOWS\system32\msctfime.ime
9 MCI command handling window, C:\WINDOWS\system32\WINMM.DLL
10 SysFader, C:\WINDOWS\system32\SHELL32.dll
Variables in use
================
Procedure Type Value
==========================
(b)ACTUA_FICHA_GRAL
Param 1: O Class: ERROR
TCOMBOBOX:CHANGE
Param 1: O Class: TCOMBOBOX
Param 2: C ""
Local 1: N 0
Local 2: U
Local 3: U
Local 4: S
(b)TCOMBOBOX
Local 1: C ""
Local 2: N 0
Local 3: U
TCOMBOBOX:RESET
Param 1: O Class: TCOMBOBOX
Param 2: U
(b)TCOMBOBOX
Param 1: U
TCOMBOBOX:SETITEMS
Param 1: O Class: TCOMBOBOX
Param 2: L .T.
Local 1: U
(b)ACTUA_FICHA_GRAL
Param 1: L .T.
TCOMBOBOX:CHANGE
Param 1: O Class: TCOMBOBOX
Param 2: C "SANTIAGO "
TCONTROL:HANDLEEVENT
Local 1: C "SANTIAGO "
Local 2: N 46
Local 3: U
TCOMBOBOX:HANDLEEVENT
Param 1: N 2053
Param 2: N 0
Param 3: N 0
Local 1: U
_FWH
Param 1: N 2053
Param 2: N 0
Param 3: N 0
SENDMESSAGE
Param 1: N 0
Param 2: N 2053
Param 3: N 0
Param 4: N 0
Param 5: N 53
Local 1: O Class: TCOMBOBOX
TDIALOG:COMMAND
Param 1: N 69884
Param 2: N 2053
Param 3: N 0
Param 4: N 0
TWINDOW:HANDLEEVENT
Param 1: N 65693
Param 2: N 69884
Local 1: U
Local 2: N 1
Local 3: N 157
Local 4: N 69884
Local 5: U
TDIALOG:HANDLEEVENT
Param 1: N 273
Param 2: N 65693
Param 3: N 69884
DIALOGBOXINDIRECT
Param 1: N 273
Param 2: N 65693
Param 3: N 69884
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C " @ ) ‡ P K „ z S T A T I C M A E S T R O D E P A C I E N T E S P e` { B U T T O N P t eR | B U T T O N P Ã e } B U T T O N P A
~ S T A T I C N r o . F i c h a P Ã A
S T A T I C F e c h a d e I n g r e s o P A
€ S T A T I C R . u . t . P d d
S T A T I C ( E j . 9 9 9 9 9 9 9 9 - 9 ) P Ô 3
‚ S T A T I C P a s a p o r t e P - A
ƒ S T A T I C N o m b r e s P < A
„ S T A T I C A p e l l i d o s P K A
… S T A T I C F e c h a N a c i . P ‘ K
† S T A T I C E d a d P ¾ K #
‡ S T A T I C A ñ o s P Z A
ˆ S T A T I C S e x o P i A
‰ S T A T I C E s t a d o C i v i l P œ i (
Š S T A T I C H i j o s P } A
‹ S T A T I C N a c i o n a l i d a d P Œ A
Œ S T A T I C D i r e c c i ó n P › A
S T A T I C C i u d a d P ¯ › A
Ž S T A T I C C o m u n a P ª A
S T A T I C C e l u l a r P e r s o n a l P ¯ ª A
S T A T I C C e l u l a r C o n t a c . P ¹ A
‘ S T A T I C C o r r e o E l e c t r o n i c o P Í A
’ S T A T I C O c u p a c i ó n P ú Í
“ T B T N B M P €P U -
” S T A T I C 1 €P 2
• S T A T I C 1 2 / 0 8 / 2 0 2 2 € P U <
– E D I T . . ˆ P P — E D I T ˆ P U - – ˜ E D I T ˆ P U < – ™ E D I T € P U K 2 š E D I T / / €P ´ K › S T A T I C 0 ¡P U Z 7 Z œ C O M B O B O X ¡P U › Z } C O M B O B O X ¡P ú › Z } ž C O M B O B O X P
é C- Ÿ B U T T O N P d ó T B T N B M P G R A B A P ó ¡ T B T N B M P M O D I F I P ú ó ¢ T B T N B M P S A L I R "
Param 3: N 528434
Param 4: O Class: TDIALOG
ACTUA_FICHA_GRAL
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: L .F.
Param 13: O Class: TDIALOG
Param 14: U
Local 1: N 528434
Local 2: S
Local 3: O Class: TDIALOG
(b)MENU
Local 1: O Class: TDIALOG
Local 2: O Class: TFONT
Local 3: O Class: TFONT
Local 4: O Class: TFONT
Local 5: O Class: TFONT
Local 6: O Class: TFONT
Local 7: O Class: TBTNBMP
Local 8: O Class: TGROUP
Local 9: O Class: TGROUP
Local 10: O Class: TGET
Local 11: O Class: TGET
Local 12: O Class: TGET
Local 13: O Class: TGET
Local 14: O Class: TGET
Local 15: O Class: TSAY
Local 16: O Class: TCOMBOBOX
Local 17: O Class: TCOMBOBOX
Local 18: O Class: TCOMBOBOX
Local 19: O Class: TSAY
Local 20: O Class: TSAY
TMENU:COMMAND
Param 1: O Class: TMENUITEM
TWINDOW:COMMAND
Param 1: N 20017
Local 1: O Class: TMENUITEM
TWINDOW:HANDLEEVENT
Param 1: N 20017
Param 2: N 0
Local 1: N 0
Local 2: N 20017
Local 3: N 0
Local 4: U
_FWH
Param 1: N 273
Param 2: N 20017
Param 3: N 0
WINRUN
Param 1: N 0
Param 2: N 273
Param 3: N 20017
Param 4: N 0
Param 5: N 1
Local 1: O Class: TWINDOW
TWINDOW:ACTIVATE
Param 1: N 528434
MAIN
Param 1: C "MAXIMIZED"
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: U
Param 13: U
Param 14: U
Param 15: U
Param 16: U
Param 17: B {|| ... }
Param 18: U
Param 19: U
Param 20: L .F.
Local 1: O Class: TWINDOW
Local 2: U
Local 3: U
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFCDX
Codigo:
- Code: Select all Expand view RUN
@ 310,170 ComboBox oGet8 Var nCiud Items ArrTranspose(aCiudades)[2] SIZE 180,250 PIXEL OF oDlg2 FONT oFont6
oGet8:bChange := { || aItemsGet9:=Carga_Comu(ArrTranspose(aCiudades)[1][oGet8:nAt]) ,;
oGet9:SetItems(aItemsGet9) ,;
oGet9:Refresh() }
@ 310,500 ComboBox oGet9 Var nComu Items ArrTranspose(aComunas)[2] SIZE 180,250 PIXEL OF oDlg2 FONT oFont6;
ON CHANGE (Cod_Com1:=ArrTranspose(aComunas)[1][oGet9:nAt])
Function Carga_Comu(Cod_Ciu1)
aComunas := {}
Abre_dbf("Comunas",2,.f.,"")
set inde to comunas
DbSetorder(2)
DbGoTop()
AADD( aComunas,{ 0," "})
Do While !Eof()
If Cod_Prov=Cod_Ciu1
Aadd(aComunas, { b->Cod_Com,b->Nom_Com})
Endif
DbSkip()
EndDo
Dbclosearea()
Return .t.