Valide sous UNIX et Windows
GetMIFInteger extrait la valeur d'un attribut Integer spécifique d'un fichier MIF.
Cette fonction MIF et Inv présente le format suivant :
GetMIFInteger(Filename as string, GroupName as string, AttrName as string) as integer
GetMIFInteger(Filename as string, GroupID as integer, AttrID as integer) as integer
GetMIFInteger(Filename as string, GroupName as string, GroupID as integer, AttrName as string, AttrID as integer) as integer
Nom du fichier MIF.
Indique le nom du groupe dans lequel se trouve l'attribut.
Indique l'ID du groupe dans lequel se trouve l'attribut.
Indique le nom de l'attribut à partir duquel la valeur doit être extraite.
Indique l'ID de l'attribut à partir duquel extraire la valeur.
Si l'attribut spécifié se trouve dans le fichier MIF, la fonction GetMIFInteger renvoie la valeur de l'attribut Integer, sinon elle renvoie 0.
Exemple : Fonction GetMIFInteger
Voici un exemple des fonctions GetMIFComponent, GetMIFInteger, GetMIFString, GetMIFValue et SetMIFValue.
Dim file, gname, aname as string
Dim gid as integer
ClrScr()
file = "h:\test\miffus\file.mif"
Print("Composant de """ + file + """: """ + GetMIFComponent(file) + """")
gname = "Chaînes"
gId = 1
aname = "string_1"
Print(gname + "." + aname + " = " + GetMIFString(file, gname, gId, aname, 1))
aname = "string_2"
Print(gname + "." + aname + " = " + GetMIFValue(file, gname, gId, aname, 2))
if SetMIFValue(file, gname, gId, aname, 2, "Text_new") then
Print(gname + "." + aname + " = " + GetMIFValue(file, gname, gId, aname, 2))
else
Print("1. Echec de SetMIFValue.")
quitter
endif
gname = "Nombres"
gId = 2
aname = "number_1"
Print(gname + "." + aname + " = " + Str(GetMIFInteger(file, gname, gId, aname, 1)))
aname = "number_2"
Print(gname + "." + aname + " = " + GetMIFValue(file, gname, gId, aname, 2))
if SetMIFValue(file, gname, gId, aname, 2, "999999") then
Print(gname + "." + aname + " = " + GetMIFValue(file, gname, gId, aname, 2))
else
Print("2. Echec de SetMIFValue.")
quitter
endif
|
Copyright © 2013 CA.
Tous droits réservés.
|
|