I am trying to read a string from modopts.ini and wanting to split the string filtering out whitespace and then iterating through the string for a match ...
modopts.ini example:
[mysection]
something = bla blah bleh bladdie bluh ble
my.js
var mystuff = load({}, 'modopts.ini', 'mysection');
var stuff = mystuff.something.split((/(\s+)/);
gives a JS TypeError: mystuff.something is undefined
What am I doing wrong, please?
Re: Parsing modopts.ini
By: Mortifis to All on Thu Nov 14 2019 11:28 am
I am trying to read a string from modopts.ini and wanting to split the string filtering out whitespace and then iterating through the string for a match ...
modopts.ini example:
[mysection]
something = bla blah bleh bladdie bluh ble
my.js
var mystuff = load({}, 'modopts.ini', 'mysection');
var stuff = mystuff.something.split((/(\s+)/);
^^^^^^^^^^^^^gives a JS TypeError: mystuff.something is undefined
What am I doing wrong, please?
The second argument to load() should be 'modopts.js' there (not modopts.ini).
| Sysop: | Eric Oulashin |
|---|---|
| Location: | Beaverton, Oregon, USA |
| Users: | 124 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 05:54:53 |
| Calls: | 7,351 |
| Calls today: | 3 |
| Files: | 9,250 |
| D/L today: |
207 files (44,657K bytes) |
| Messages: | 383,698 |
| Posted today: | 1 |