4cade/bin/makesorted.js

32 lines
515 B
JavaScript
Raw Normal View History

2021-10-21 23:27:11 +00:00
a = new ActiveXObject("scripting.filesystemobject")
b = a.opentextfile("res\\GAMES.CONF")
c = []
2021-10-22 14:12:57 +00:00
q = a.createtextfile("build\\GAMES.CONF")
2021-10-21 23:27:11 +00:00
while (!b.atendofstream)
{
d = b.readline()
e = d.indexOf("#")
if (e >= 0)
{
d = d.substr(0, e)
}
e = d.indexOf("=")
if (e == -1)
{
e = d.length
}
if (d.length > 0)
{
2021-10-22 15:23:54 +00:00
q.write(d + "\n")
2021-10-21 23:27:11 +00:00
f = d.indexOf(",") + 1
c.push(d.substr(f, e - f))
}
}
a.createtextfile("build\\GAMES.SORTED").write(c.sort().toString().replace(/,/g, "\n"))