PROFILE.Write |
result = PROFILE.Write( hHandle AS HANDLE, key AS STRING, valuename AS STRING, value AS VARIANT ) AS INTEGER
Writes the specified value to the profile using key and valuename. You can add additional sub trees by adding tokens to valuename delimited by a colon ':'
For example "Name:First".
Example:
$LIBRARY "MyBASIC2_ExtLib.dll"
DIM Name AS STRING DIM Age AS INTEGER DIM Weight AS REAL
hHandle AS HANDLE
hHandle = PROFILE.Open( "d:\kalle.xml" )
IF hHandle <> NULL THEN PROFILE.Write( hHandle, "Person", "Name:First", "Kalle" ) PROFILE.Write( hHandle, "Person", "Name:Last", "Anka" ) PROFILE.Write( hHandle, "Person", "Age", 54 ) PROFILE.Write( hHandle, "Person", "Weight", 164.5 ) PROFILE.Close( hHandle ) ENDIF
hHandle = PROFILE.Open( "d:\kalle.xml" )
IF hHandle <> NULL THEN Name = PROFILE.Read( hHandle, "Person", "Name:First", "" ) + " " + PROFILE.Read( hHandle, "Person", "Name:Last", "" ) Age = PROFILE.Read( hHandle, "Person", "Age", 18 ) Weight = PROFILE.Read( hHandle, "Person", "Weight", 200 ) PROFILE.Close( hHandle ) ENDIF
END |