Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Leading Spaces for get_config_string()

This thread is locked; no one can reply to it. rss feed Print
Leading Spaces for get_config_string()
ZoriaRPG
Member #16,714
July 2017
avatar

Is there any way to put a string in a config file, with leading spaces, that get_config_string() will parse?

get_config_string() ignores whitespace, and from what I can see, it reads escape characters as raw text, so, '/t' is read in as a slash and a 't' inside the string, rather than as proper escape sequence characters.

Can I use esc sequences somehow, or otherwise insert leading spaces, or tabs, into the string?

(The issue is this:

str = /t string

//produces a c.string of "/t string", not a char array with '/t' as the first char.

I could of course, reprocess the string and manually convert esc sequences into char, but that's a huge pain in the arse, so if there's a simpler way, I'd prefer it.

Elias
Member #358
May 2000

I don't know if that helps, but escape sequences would use a backslash not a slash.

--
"Either help out or stop whining" - Evert

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

ZoriaRPG
Member #16,714
July 2017
avatar

Elias said:

I don't know if that helps, but escape sequences would use a backslash not a slash.

I think that was just an error in my post here, but I'll double-check. I could just be a moron.

I have a config file reader and writer, but it strips leading and trailing whitespace off of values. Why do you want escape characters in a config file?

Have a look at the ZQuest Module format:

http://timelord.insomnia247.nl/zc-dev/2.55/modules/classic/classic.zmod

Go to: