Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Source Help

better way of making a string with vars in it?

A community discussion post from the original code:zIRON forum.

Molotov member
Posts
49
Threads
21
Location
Behind Keyboard

better way of making a string with vars in it?

Is there a better/faster/easier way of doing this?

	strlcpy(settings,'Language=',9);
	strAppend(settings,@zAppLanguage,512);
	strAppend(settings,'\r\nConfirmExit=',512);
	strAppend(settings,@zAppConfirmExit,512);
	strAppend(settings,'\r\nLogActions=', 512);
	strAppend(settings,@zAppLogActions,512);

cheers

"Lerning new things is what life is all about, if you are always doing the same old things day in and day out you might aswell just kill yourself." - ME d^_^b

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

there is a macro in strings.zir to make it easier

  settings = 0; //make sure var starts with null char.

  strJoin(settings, 'Language=', @zAppLanguage, '\r\nConfirmExit=', @zAppConfirmExit, '\r\nnLogActions=', @zAppLogActions, 512);
Molotov member
Posts
49
Threads
21
Location
Behind Keyboard

Ah must have missed that one..

thanks. :)

"Lerning new things is what life is all about, if you are always doing the same old things day in and day out you might aswell just kill yourself." - ME d^_^b