Visual Basic - Urgente !!Uso de archivos INI

Life is soft - evento anual de software empresarial
 
Vista:

Urgente !!Uso de archivos INI

Publicado por Victor L (26 intervenciones) el 18/09/2002 18:32:18
Necesito saber como puedo hacer para erscatar los datos de un archivo INI y pasarselos a unas variables, Solo me resulta rescatando UNO solo pero necesito me rescate todos los valores que he asicgano EJ:

[parametros]
IVA=1.18
Retencion=0.5
Caduca=30/12/2002

y esos valores pasarselos a unas variables, lo he hecho con una API de windows pero me rescata solo el primer valor

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

RE:Urgente !!Uso de archivos INI

Publicado por txibit.es.fm (29 intervenciones) el 18/09/2002 21:34:37
Yo para leer y escribir datos en ficheros INI utilizo estas funciones, quizá te sean útiles:

Public Function IniLeer(sIniNombre As String, sSeccion As String, sValor As String) As Variant
Dim sValorDevuelto As String * 250
Dim iRetorno As Integer

iRetorno = GetPrivateProfileString(sSeccion, sValor, "", sValorDevuelto, Len(sValorDevuelto), sIniNombre)
If iRetorno = 0 Then
' --- No hay Nada seleccionado
IniLeer = ""
Else
IniLeer = Mid(sValorDevuelto, 1, iRetorno)
End If
End Function

Public Sub IniEscribir(sIniNombre As String, sSeccion As String, sValor As String, sValorGrabar As String)
Dim iRetorno As Integer

iRetorno = WritePrivateProfileString(sSeccion, sValor, sValorGrabar, sIniNombre)
End Sub

Lógicamente, tendrás que declarar las APIs Getprivateprofilestring y writeprivateprofilestring.

Un saludo.

www.txibit.es.fm
www.txibit.es.vg
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