Is there somewhere in the "J code corpus" utilities for reading and writing
INI-files that either comply with the "classical" text file format or with
the nowadays recommended XML-format?

It's not really important how data is stored as long as it's portable (not
using the WIN API, the WIN registry or any database)

Simulation from a J session:

   WriteIniString ;:'AppName ','KeyName ','ValString ','File.ini'
1
   GetIniString ;:'AppName ','KeyName ','Default ','File.ini'
ValString
   GetIniString ;:'AppName ','KeyName ','Default ','xyz'
Default

or boxed result
┌───────┐
│Default      │
└───────┘

Example file "classical" format:
[fonts]
font1=Arial Unicode MS
...
[extensions]
...
[mci extensions]
aif=MPEGVideo
mp2v=MPEGVideo
mp3=MPEGVideo2
...
[files]
...
[Mail]
MAPI=1
CMC=1
CMCDLLNAME32=mapi32.dll
...


Example file XML format:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<RZML v="6.01" app="J" path="C:/J601/User/DemoApp/demo.ini">
<PREFS>
<VCLR n="Color" r="128" g="128" b="128"/>
<VSTR n="Image" v=""/>
<VINT n="ThumbnailSize" v="128"/>
<VBOOL n="ClearUndoBufferOnSave" v="1"/>
<VREAL n="Zoom" v="2"/>
</PREFS>
</RZML>



Gerald
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to