/
Inicio :: Foros

 F.A.Q.F.A.Q.                  Conéctese para revisar sus mensajesConéctese para revisar sus mensajes   

PROBLEMAS CON FILEGET MIGRANDO DE VB A VB 2005

 
      Índice del Foro elrincondelc.com -> Visual Basic
Ver tema anterior :: Ver siguiente tema  
AutorMensaje
tonidura



Registrado: 05 Dic 2006
Mensajes: 1

MensajePublicado: 05/12/2006 7:44 am
Título: PROBLEMAS CON FILEGET MIGRANDO DE VB A VB 2005

TENGO UN PROBLEMA QUE ME ESTÁ VOLVIENDO LOCO,EN VB ME ESTA
FUNCIONANDO Y EN
VB 2005 ME DA EL SIGUIENTE ERROR CUANDO LLEGO A LA SENTENCIA
:FileGet(1, Empresa, C)

EL ERROR QUE ME DA ES

"No se controló EndOfStreamException".No se puede leer mas alla del
final de la secuencia

SI ALGUIEN LE PUEDE DAR UN VISTAZO AL CODIGO,ME HAREIS UN GRANDÍSIMO
FAVOR.

TENIA ESTE CODIGO EN VB 6.0:

Private Sub EmpresaInicio()

Dim Empresa As JabEmpresa, C As Integer
Open "C:\proyectoindo\datos\JabEmp" + Format$(partida) + ".Dat" For
Random As #1 Len = JabEmpresaLongitud
NumeroDeEmpresas = LOF(1) / JabEmpresaLongitud
For C = 1 To NumeroDeEmpresas
Get #1, C, Empresa
cboNombre.AddItem Empresa.Nombre
Next C
Close #1

End Sub

Type JabEmpresa
Nombre As String * 32

Margen As Single
Deuda As Single
InteresDeuda As Single
Amortizacion As Single
Inversiones As Single
RiesgoInversion As Single
Impuestos As Single
Crecimiento As Single
Dividendos As Single

PrecioAccion As Single
Declarada As Integer 'sirve para saber si de esta empresa se han
introducido los valores del balance
Inmovilizado As Single
Instalaciones As Single
Terrenos As Single
Mobiliario As Single
Almacenes As Single
Maquinaria As Single
ActivoCirculante As Single
RealizableTecnico As Single

StocksMateriasPrimas As Single
StocksProductosAcabados As Single
RealizableFinanciero As Single
Clientes As Single
ClientesMorosos As Single
Valores As Single
Tesoreria As Single
CajaYBancos As Single
ActivoTotal As Single
RecursosAjenos As Single

DeudasBancarias As Single
Largo As Single
SinGarantia As Single
InteresesPendientes As Single
ProveedoresYAcreed As Single
OtrasDeudas As Single
HaciendaPublica As Single
SeguridadSocial As Single
RecursosPropios As Single
CapitalSuscrito As Single

Reservas As Single
Resultados As Single
BeneficiosAcumulados As Single
BeneficiosNetos As Single
PasivoTotal As Single
Paneco As Single
ImpuestoSoociedades As Single
BenefDespImpues As Single
CargaFinanciera As Single
RendDeudaPublica As Single
Flag1 As Integer
RentabilidadRentaFija As Single
RentabilidadMercado As Single
PrecioInicial As Single
PrecioOfertado As Single
RepercusionCostos As Single
RepercusionBeneficios As Single
PeticionCredito As Single
ValorReal As Single '59

End Type

en VB 2005:

Private Sub EmpresaInicio()
Dim Empresa As New JabEmpresa
Dim C As Short
FileOpen(1, "C:\Proyecto2307\proyectovisual2005\datos\JabEmp"
& VB6.Format(partida) & ".Dat", OpenMode.Random, , ,
JabEmpresaLongitud)

NumeroDeEmpresas = CShort(LOF(1) / JabEmpresaLongitud)

For C = 1 To NumeroDeEmpresas

FileGet(1, Empresa, C)
cboNombre.Items.Add(Empresa.Nombre)
Next C
FileClose(1)
End Sub

Structure JabEmpresa

<VBFixedString(32),
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray,
SizeConst:=33)> Public Nombre() As Char
Dim Margen As Single
Dim Deuda As Single
Dim InteresDeuda As Single
Dim Amortizacion As Single
Dim Inversiones As Single
Dim RiesgoInversion As Single
Dim Impuestos As Single
Dim Crecimiento As Single
Dim Dividendos As Single
Dim PrecioAccion As Single
Dim Declarada As Short
Dim Inmovilizado As Single
Dim Instalaciones As Single
Dim Terrenos As Single
Dim Mobiliario As Single
Dim Almacenes As Single
Dim Maquinaria As Single
Dim ActivoCirculante As Single
Dim RealizableTecnico As Single
Dim StocksMateriasPrimas As Single
Dim StocksProductosAcabados As Single
Dim RealizableFinanciero As Single
Dim Clientes As Single
Dim ClientesMorosos As Single
Dim Valores As Single
Dim Tesoreria As Single
Dim CajaYBancos As Single
Dim ActivoTotal As Single
Dim RecursosAjenos As Single
Dim DeudasBancarias As Single
Dim Largo As Single
Dim SinGarantia As Single
Dim InteresesPendientes As Single
Dim ProveedoresYAcreed As Single
Dim OtrasDeudas As Single
Dim HaciendaPublica As Single
Dim SeguridadSocial As Single
Dim RecursosPropios As Single
Dim CapitalSuscrito As Single
Dim Reservas As Single
Dim Resultados As Single
Dim BeneficiosAcumulados As Single
Dim BeneficiosNetos As Single
Dim PasivoTotal As Single
Dim Paneco As Single
Dim ImpuestoSoociedades As Single
Dim BenefDespImpues As Single
Dim CargaFinanciera As Single
Dim RendDeudaPublica As Single
Dim Flag1 As Short
Dim RentabilidadRentaFija As Single
Dim RentabilidadMercado As Single
Dim PrecioInicial As Single
Dim PrecioOfertado As Single
Dim RepercusionCostos As Single
Dim RepercusionBeneficios As Single
Dim PeticionCredito As Single
Dim ValorReal As Single
End Structure

DATOS :

LOF(1) =814

JabEmpresaLongitud=277
'EL ERROR ME LO DA EN LA PRIMERA ITERACION(FOR) ,CUANDO C=1 [/b]
Volver arriba
      Índice del Foro elrincondelc.com -> Visual Basic
Página 1 de 1Todas las horas están en GMT - 8 Horas

 
No puede crear mensajes
No puede responder temas
No puede editar sus mensajes
No puede borrar sus mensajes
No puede votar en encuestas

(c) ElRincondelC.com

Un proyecto de UrlanHeat.com