Previous Topic: CreateMIFInteger - Create an Integer AttributeNext Topic: GetMIFComponent or GetComponent - Retrieve the Component Name


CreateMIFString - Create a String Attribute

Valid on UNIX and Windows

CreateMIFString creates a string attribute in an existing group in an existing MIF file.

Function format:

CreateMIFString (Filename as String, Group as String, Name as String, Value as String, Description as String) as Integer
Filename

Specifies the name of the MIF file in which to create the string attribute.

Group

Specifies the group in which the string attribute is created. It can be a string specifying the name of the group or an integer specifying the ID of the group. The ID is the value returned by a call to the CreateMIFGroup function.

Name

Specifies the name of the attribute.

Value

String specifying the value of the attribute.

Description

Specifies the description of the attribute.

On successful completion, the function returns the ID of the attribute within the group in the MIF file; otherwise, returns zero.

Example:

Dim Dir as String
Dim DriveFree as Integer

'Get directory
Dir = GetDirectory(3)
DriveFree = GetDiskFreeMB(3)

'Create .MIF file
CreateMIFFile(ComputerPath+"Disk.MIF","My Disk Inventory ","","")
CreateMIFGroup(ComputerPath+"Disk.MIF","Disk Info","Disk information","AMClass")
CreateMIFString(ComputerPath+"Disk.MIF","Disk Info","Current Dir",Dir,"Dir name")
CreateMIFInteger(ComputerPath+"Disk.MIF","Disk Info","Free in MB",DriveFree,"Free MB")