Visual Basic - Calificador no Válido!

Life is soft - evento anual de software empresarial
 
Vista:

Calificador no Válido!

Publicado por Germany (53 intervenciones) el 09/10/2006 22:27:04
Saludos!
Estoy imprimiendo un recibo y me sale Error de compilacion calificador no válido y se me posiciona en (Text3(i).Text)

aqui le dejo las lineas de codigo para q por favor las revisen y me digan q estoy haciendo mal
__________________________________
Private Sub LaVolpeButton9_Click()

Printer.ScaleMode = vbCharacters
Printer.TrackDefault = True

For i = 1 To 8
Printer.Print ""
Next

Printer.Print ""
Printer.FontName = "Arial"
Printer.FontSize = 10
Printer.FontBold = False
Printer.FontUnderline = False

Printer.Print Tab(96); Label1.Caption; Tab(112); Text1.Text
Printer.Print Tab(23); Label2.Caption; Tab(46); Label3.Caption

Printer.Print Tab(23); Label4.Caption; Tab(44); Label46.Caption
Printer.Print Tab(23); Label5.Caption; Tab(96); Label8.Caption
Printer.Print Tab(23); Label6.Caption; Tab(96); Label9.Caption
Printer.Print Tab(23); Label7.Caption; Tab(96); Label10.Caption; Tab(105); Label11.Caption

Printer.Print ""

Printer.Print Tab(23); Label12.Caption
Printer.Print Tab(23); Label13.Caption
Printer.Print Tab(23); Label14.Caption
Printer.Print Tab(23); Label15.Caption
Printer.Print Tab(23); Label16.Caption
Printer.Print Tab(23); Label31.Caption
'''''''''''''''''''''''''

Printer.Print ""

Printer.Print Tab(30); Label17.Caption; Tab(40); Label18.Caption

'''''''''''''''''''
Printer.Print Tab(30); Combo1.Text; Tab(40); Label49.Caption; Tab(65); Label28.Caption; Tab(83); Text2.Text; Tab(110); Label19.Caption; Tab(115); Text12.Text
'''''''''''''''''''
Dim Text3(7) As Integer

For i = 0 To 7
If Trim$(Text3(i).Text) <> "" Then Printer.Print Text3(i).Text 'ACA ES DONDE TENGO EL ERROR!

Next

'''''''''''''''''''
Printer.Print ""
If Label41.Visible = True Then
Printer.Print Tab(31); Label41.Caption; Tab(36); Label47.Caption; Tab(43); Label43.Caption; Tab(55); Label14.Caption; Tab(69); Label45.Caption; Tab(110); Label21.Caption; Tab(115); Text14.Text

Printer.Print ""
Printer.Print Tab(40); Label30.Caption; Tab(115); Text11.Text

Else
If Label41.Visible = False Then

Printer.Print ""
Printer.Print Tab(40); Label30.Caption; Tab(115); Text11.Text

Printer.Print ""

Printer.Print Tab(23); Label29.Caption
Printer.Print Tab(23); Label34.Caption; Tab(37); Label32.Caption; Tab(53); Label36.Caption; Tab(65); Label40.Caption
Printer.Print Tab(23); Label35.Caption; Tab(33); Label33.Caption; Tab(54); Label37.Caption; Tab(63); Label48.Caption; Tab(80); Label38.Caption; Tab(95); Label50.Caption

Printer.Print ""
Printer.Print ""
Printer.Print ""
Printer.Print Tab(23); Label39.Caption
Printer.Print Tab(23); Label51.Caption
Printer.Print Tab(23); Label53.Caption

Printer.EndDoc

End If
End If
End Sub
_________________

Gracias de antemano!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Dim Text3(7) As Integer ' son del 0 al 6

Publicado por SemperFiMXL (25 intervenciones) el 10/10/2006 00:27:44
El problema se presenta porque estas tratando de accesar un Text3(7) segun el indice (0 to 7) que estas indicando en el FOR y en el DIM estas especificando que son 7 elementos y estos quedan numerados del 0 al 6 ...

1) O modificas el Dim dejandolo como Dim Text3(8) As Integer para que los elementos existan del 0 al 7 ...

2) O bien, modificas el FOR dejandolo como For i = 0 To 6 para solo accesar los elementos del 0-6 que definiste con el DIM

Saludos !!

''''''''''''''''''''''''

Dim Text3(7) As Integer '<-- El problema esta aqui (los elementos son 0 al 6)

For i = 0 To 7 '<-- al intentar accesar al elemento # 7 se genera el error !!
If Trim$(Text3(i).Text) <> "" Then Printer.Print Text3(i).Text 'ACA ES DONDE TENGO EL ERROR!

Next

''''''''''''''''''''''
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Dim Text3(7) As Integer ' son del 0 al 6

Publicado por Unomàsnomàs (77 intervenciones) el 10/10/2006 01:29:21
Yo opino que el error posiblemente sea por una confusion de tipos... para empezar el text3(X) es un control text en forma de array pegado en tu formulario o es un nombre de variable cualquiera definiendola como array?.. dime..
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Dim Text3(7) As Integer ' son del 0 al 6

Publicado por Germany (53 intervenciones) el 10/10/2006 15:34:18
SemperFiMXL : amigo hice lo que me sugeriste pero aún asi nada! sigue saliendo el mismo error y se posciona en el mismo lugar que dije anteriormente :(

Unomásnomás: me cree un matriz de text3 y estan "pegado " al formulario

Muchas gracias por la ayuda! la verdad no entiendo lo que esta pasando espero encontrarle solucion...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Solucionado

Publicado por Germany (2 intervenciones) el 10/10/2006 19:51:09
Ya funciona ! lo que pasaba es que declare el text3 como array ! y no era necesario ! con tenerlos en el form era suficiente !

Gracias!!!!!!!!!!!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar