Index: cpp/frams/param/multiparamload.cpp
===================================================================
--- cpp/frams/param/multiparamload.cpp	(revision 704)
+++ cpp/frams/param/multiparamload.cpp	(revision 720)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -10,33 +10,33 @@
 void MultiParamLoader::init()
 {
-file=0; ownfile=0;
-status=0;
-reset();
+	file = 0; ownfile = 0;
+	status = 0;
+	reset();
 }
 
 void MultiParamLoader::reset()
 {
-status=0;
-breakcond=OnError;
-aborting=false;
-emptyparam.setParamTab(empty_paramtab);
-linenum=0;
+	status = 0;
+	breakcond = OnError;
+	aborting = false;
+	emptyparam.setParamTab(empty_paramtab);
+	linenum = 0;
 }
 
 int MultiParamLoader::findObject(const ExtObject &o)
 {
-for(int i=0;i<objects.size();i++)
-	if ((*objects(i))==o)
-		return i;
-return -1;
+	for (int i = 0; i < objects.size(); i++)
+		if ((*objects(i)) == o)
+			return i;
+	return -1;
 }
 
 void MultiParamLoader::removeObject(const ExtObject &o)
 {
-int i=findObject(o);
-if (i>=0)
-	{
-	delete objects(i);
-	objects-=i;
+	int i = findObject(o);
+	if (i >= 0)
+	{
+		delete objects(i);
+		objects -= i;
 	}
 }
@@ -44,204 +44,208 @@
 void MultiParamLoader::clearObjects()
 {
-FOREACH(ExtObject*,o,objects)
-	delete o;
-objects.clear();
+	FOREACH(ExtObject*, o, objects)
+		delete o;
+	objects.clear();
 }
 
 void MultiParamLoader::load()
 {
-clearstack();
-if (!file)
-	{
-	lasterror="can't open file";
-	status=OnError;
-	return;
-	}
-status=Loading;
-aborting=false;
+	clearstack();
+	if (!file)
+	{
+		lasterror = "can't open file";
+		status = OnError;
+		return;
+	}
+	status = Loading;
+	aborting = false;
 }
 
 void MultiParamLoader::abort()
 {
-if (file && ownfile)
-	{
-	delete file;
-	file=0;
-	}
-clearstack();
-status=Finished;
-aborting=true;
+	if (file && ownfile)
+	{
+		delete file;
+		file = 0;
+	}
+	clearstack();
+	status = Finished;
+	aborting = true;
 }
 
 void MultiParamLoader::load(VirtFILE *f)
 {
-abort();
-ownfile=0;
-file=f;
-load();
+	abort();
+	ownfile = 0;
+	file = f;
+	load();
 }
 
 void MultiParamLoader::load(const char* filename)
 {
-abort();
-ownfile=1;
-file=Vfopen(filename,FOPEN_READ_BINARY);
-load();
+	abort();
+	ownfile = 1;
+	file = Vfopen(filename, FOPEN_READ_BINARY);
+	load();
 }
 
 int MultiParamLoader::go()
 {
-SString buf;
-if (status==OnError) return status;
-int unexpected_line = 0;
-while (!finished())
-	{
-	if ((status==BeforeObject) || ((status==BeforeUnknown) && !lastobject.isEmpty()))
-		{
-		Param tmp_param;
-		ParamInterface *pi=lastobject.getParamInterface(tmp_param);
-		pi->load(file,true,&aborting,&linenum);
-		if ((status!=Finished) && maybeBreak(AfterObject))
-			break;
-		unexpected_line = 0;
-		continue;
-		}
-	else if (status==BeforeUnknown)
-		{
-		logPrintf("MultiParamLoader","go",LOG_WARN,"Skipping object '%s'",lastunknown.c_str());
-		loadObjectNow(&emptyparam,false);
-		continue;
-		}
-	if (!loadSStringLine(file,buf))
-		{
-		unexpected_line = 0;
-		if (!returnFromIncluded())
-			{
-			abort();
-			break;
-			}
-		else
+	SString buf;
+	if (status == OnError) return status;
+	int unexpected_line = 0;
+	while (!finished())
+	{
+		if ((status == BeforeObject) || ((status == BeforeUnknown) && !lastobject.isEmpty()))
+		{
+			Param tmp_param;
+			ParamInterface *pi = lastobject.getParamInterface(tmp_param);
+			ParamInterface::LoadOptions opts;
+			opts.abortable = &aborting;
+			opts.warn_unknown_fields = true;
+			opts.linenum = &linenum;
+			pi->load(ParamInterface::FormatMultiLine, file, &opts);
+			if ((status != Finished) && maybeBreak(AfterObject))
+				break;
+			unexpected_line = 0;
 			continue;
 		}
-	linenum++;
-	if (buf[0]=='#')
-		{
-		unexpected_line = 0;
-		if (buf.startsWith("#include"))
-			{
-			const char* t=strchr(buf.c_str(),'\"'),*t2=0;
-			if (t)
-				t2=strchr(t+1,'\"');
-			if (t2)
+		else if (status == BeforeUnknown)
+		{
+			logPrintf("MultiParamLoader", "go", LOG_WARN, "Skipping object '%s'", lastunknown.c_str());
+			loadObjectNow(&emptyparam, false);
+			continue;
+		}
+		if (!loadSStringLine(file, buf))
+		{
+			unexpected_line = 0;
+			if (!returnFromIncluded())
+			{
+				abort();
+				break;
+			}
+			else
+				continue;
+		}
+		linenum++;
+		if (buf[0] == '#')
+		{
+			unexpected_line = 0;
+			if (buf.startsWith("#include"))
+			{
+				const char* t = strchr(buf.c_str(), '\"'), *t2 = 0;
+				if (t)
+					t2 = strchr(t + 1, '\"');
+				if (t2)
 				{
-				SString filename(t+1,t2-t-1);
-				includeFile(filename);
+					SString filename(t + 1, t2 - t - 1);
+					includeFile(filename);
 				}
-			else
+				else
 				{
-				const char* thisfilename=file->VgetPath();
-				logPrintf("MultiParamLoader","go",LOG_WARN,"invalid \"%s\"%s%s",buf.c_str(),
-					 (thisfilename?" in ":""),(thisfilename?thisfilename:""));
+					const char* thisfilename = file->VgetPath();
+					logPrintf("MultiParamLoader", "go", LOG_WARN, "invalid \"%s\"%s%s", buf.c_str(),
+						(thisfilename ? " in " : ""), (thisfilename ? thisfilename : ""));
 				}
+				continue;
+			}
+			else if ((status != Finished) && maybeBreak(OnComment))
+			{
+				lastcomment = buf.substr(1);
+				break;
+			}
 			continue;
-			}
-		else if ((status!=Finished) && maybeBreak(OnComment))
-			{
-			lastcomment=buf.substr(1);
-			break;
-			}
-		continue;
-		}
-	buf=trim(buf);
-	if (buf.len()==0)
-		unexpected_line = 0;
-	else if ((buf.len()>1)&&(buf[buf.len()-1]==':'))
-		{
-		unexpected_line = 0;
-		lastunknown=0;
-		lastunknown=buf.substr(0,buf.len()-1);
-		lastobject.setEmpty();
-		FOREACH(ExtObject*,o,objects)
-			{
-			if (!strcmp(o->interfaceName(),lastunknown.c_str())) {lastobject=*o; break;}
+		}
+		buf = trim(buf);
+		if (buf.len() == 0)
+			unexpected_line = 0;
+		else if ((buf.len() > 1) && (buf[buf.len() - 1] == ':'))
+		{
+			unexpected_line = 0;
+			lastunknown = 0;
+			lastunknown = buf.substr(0, buf.len() - 1);
+			lastobject.setEmpty();
+			FOREACH(ExtObject*, o, objects)
+			{
+				if (!strcmp(o->interfaceName(), lastunknown.c_str())) { lastobject = *o; break; }
 			}
 			if (!lastobject.isEmpty())
-				{
+			{
 				if (maybeBreak(BeforeObject))
 					break;
-				}
+			}
 			else
-				{
+			{
 				if (maybeBreak(BeforeUnknown))
 					break;
-				}
-		
-		}
+			}
+
+		}
+		else
+		{
+			switch (unexpected_line)
+			{
+			case 0:
+			{
+				const char* thisfilename = file->VgetPath();
+				logPrintf("MultiParamLoader", "go", LOG_WARN, "Ignored unexpected line %d%s",
+					linenum,
+					thisfilename ? SString::sprintf(" while reading '%s'", thisfilename).c_str() : "");
+			}
+				break;
+
+			case 1:
+				logPrintf("MultiParamLoader", "go", LOG_WARN, "The following line(s) were also unexpected and were ignored");
+				break;
+			}
+			unexpected_line++;
+		}
+	}
+	return status;
+}
+
+bool MultiParamLoader::alreadyIncluded(const char* filename)
+{
+	int i;
+	const char* t;
+	for (i = 0; i < filestack.size(); i++)
+	{
+		t = filestack(i)->VgetPath();
+		if (!t) continue;
+		if (!strcmp(filename, t)) return true;
+	}
+	return false;
+}
+
+void MultiParamLoader::includeFile(SString& filename)
+{
+	const char* thisfilename = file->VgetPath();
+	SString newfilename;
+	const char* t = thisfilename ? strrchr(thisfilename, PATH_SEPARATOR_CHAR) : 0;
+
+	if (thisfilename && t)
+	{
+		newfilename.append(thisfilename, t - thisfilename + 1);
+		newfilename += filename;
+	}
 	else
-		{
-		switch(unexpected_line)
-			{
-			case 0:
-			{
-			const char* thisfilename=file->VgetPath();
-			logPrintf("MultiParamLoader","go", LOG_WARN, "Ignored unexpected line %d%s", 
-				  linenum,
-				  thisfilename ? SString::sprintf(" while reading '%s'",thisfilename).c_str():"");
-			}
-			break;
-
-			case 1:
-			logPrintf("MultiParamLoader","go", LOG_WARN, "The following line(s) were also unexpected and were ignored");
-			break;
-			}
-		unexpected_line++;
-		}
-	}
-return status;
-}
-
-bool MultiParamLoader::alreadyIncluded(const char* filename)
-{
-int i;
-const char* t;
-for(i=0;i<filestack.size();i++)
-	{
-	t=filestack(i)->VgetPath();
-	if (!t) continue;
-	if (!strcmp(filename,t)) return true;
-	}
-return false;
-}
-
-void MultiParamLoader::includeFile(SString& filename)
-{
-const char* thisfilename=file->VgetPath();
-SString newfilename;
-const char* t=thisfilename?strrchr(thisfilename,PATH_SEPARATOR_CHAR):0;
-
-if (thisfilename && t)
-	{
-	newfilename.append(thisfilename,t-thisfilename+1);
-	newfilename+=filename;
-	}
-else
-	newfilename=filename;
-
-if (alreadyIncluded(newfilename.c_str()))
-	{
-	logPrintf("MultiParamLoader","include",LOG_WARN,"circular reference ignored (\"%s\")",
-		    filename.c_str());
-	return;
-	}
-
-VirtFILE *f=Vfopen(newfilename.c_str(),FOPEN_READ_BINARY);
-if (!f)
-	{
-	logPrintf("MultiParamLoader","include",LOG_WARN,"\"%s\" not found",newfilename.c_str());
-	}
-else
-	{
-	filestack+=file;
-	file=f;
+		newfilename = filename;
+
+	if (alreadyIncluded(newfilename.c_str()))
+	{
+		logPrintf("MultiParamLoader", "include", LOG_WARN, "circular reference ignored (\"%s\")",
+			filename.c_str());
+		return;
+	}
+
+	VirtFILE *f = Vfopen(newfilename.c_str(), FOPEN_READ_BINARY);
+	if (!f)
+	{
+		logPrintf("MultiParamLoader", "include", LOG_WARN, "\"%s\" not found", newfilename.c_str());
+	}
+	else
+	{
+		filestack += file;
+		file = f;
 	}
 }
@@ -249,51 +253,55 @@
 VirtFILE* MultiParamLoader::popstack()
 {
-if (!filestack.size()) return 0;
-VirtFILE* f=filestack(filestack.size()-1);
-filestack.remove(filestack.size()-1);
-return f;
+	if (!filestack.size()) return 0;
+	VirtFILE* f = filestack(filestack.size() - 1);
+	filestack.remove(filestack.size() - 1);
+	return f;
 }
 
 void MultiParamLoader::clearstack()
 {
-VirtFILE *f;
-while(f=popstack()) delete f;
+	VirtFILE *f;
+	while (f = popstack()) delete f;
 }
 
 bool MultiParamLoader::returnFromIncluded()
 {
-if (!filestack.size()) return false;
-if (file) delete file;
-file=popstack();
-return true;
-}
-
-int MultiParamLoader::loadObjectNow(const ExtObject& o,bool warn_unknown_fields)
-{
-Param tmp_param;
-ParamInterface *pi=o.getParamInterface(tmp_param);
-pi->load(file,warn_unknown_fields,&aborting,&linenum);
-status=AfterObject;
-return 0;
+	if (!filestack.size()) return false;
+	if (file) delete file;
+	file = popstack();
+	return true;
+}
+
+int MultiParamLoader::loadObjectNow(const ExtObject& o, bool warn_unknown_fields)
+{
+	Param tmp_param;
+	ParamInterface *pi = o.getParamInterface(tmp_param);
+	ParamInterface::LoadOptions opts;
+	opts.abortable = &aborting;
+	opts.warn_unknown_fields = warn_unknown_fields;
+	opts.linenum = &linenum;
+	pi->load(ParamInterface::FormatMultiLine, file, &opts);
+	status = AfterObject;
+	return 0;
 }
 
 int MultiParamLoader::run()
 {
-int stat;
-breakOn(OnError);
-while(stat=go())
-	if (stat==OnError)
+	int stat;
+	breakOn(OnError);
+	while (stat = go())
+		if (stat == OnError)
 		{
 		abort();
 		return 0;
 		}
-return 1;
+	return 1;
 }
 
 SString MultiParamLoader::currentFilePathForErrorMessage()
 {
-const char* filename=getFile()->VgetPath();
-if (filename)
-	return SString::sprintf(" in '%s'",filename);
-return SString::empty();
-}
+	const char* filename = getFile()->VgetPath();
+	if (filename)
+		return SString::sprintf(" in '%s'", filename);
+	return SString::empty();
+}
Index: cpp/frams/param/param.cpp
===================================================================
--- cpp/frams/param/param.cpp	(revision 704)
+++ cpp/frams/param/param.cpp	(revision 720)
@@ -10,4 +10,5 @@
 #include "common/log.h"
 #include <frams/util/sstringutils.h>
+#include <common/virtfile/stringfile.h>
 
 //#define SAVE_ALL_NAMES
@@ -356,5 +357,5 @@
 }
 
-void SimpleAbstractParam::save2(SString& f, void *defdata, bool addcr, bool all_names)
+void SimpleAbstractParam::saveSingleLine(SString& f, void *defdata, bool addcr, bool all_names)
 { // defdata!=NULL -> does not save default values
 	const char *p;
@@ -421,5 +422,55 @@
 }
 
-int ParamInterface::load(VirtFILE* f, bool warn_unknown_fields, bool *abortable, int *linenum)
+int ParamInterface::load(FileFormat format, VirtFILE* f, LoadOptions *options)
+{
+	LoadOptions default_options;
+	if (options == NULL)
+		options = &default_options;
+	switch (format)
+	{
+	case FormatMultiLine:
+		return loadMultiLine(f, *options);
+
+	case FormatSingleLine:
+	{
+		StringFILE *sf = dynamic_cast<StringFILE*>(f);
+		SString s;
+		if (sf)
+		{
+			s = sf->getString().c_str();
+			options->offset += sf->Vtell();
+		}
+		else
+		{
+			if (!loadSStringLine(f, s))
+				return -1;
+		}
+		return loadSingleLine(s, *options);
+	}
+	}
+	return -1;
+}
+
+int ParamInterface::load(FileFormat format, const SString &s, LoadOptions *options)
+{
+	LoadOptions default_options;
+	if (options == NULL)
+		options = &default_options;
+	switch (format)
+	{
+	case FormatMultiLine:
+	{
+		string std_string(s.c_str());
+		StringFILE f(std_string);
+		return loadMultiLine(&f, *options);
+	}
+
+	case FormatSingleLine:
+		return loadSingleLine(s, *options);
+	}
+	return -1;
+}
+
+int ParamInterface::loadMultiLine(VirtFILE* f, LoadOptions &options)
 {
 	SString buf;
@@ -434,7 +485,7 @@
 	if ((i = findId("beforeLoad")) >= 0)
 		call(i, NULL, NULL);
-	while (((!abortable) || (!*abortable)) && loadSStringLine(f, buf))
-	{
-		if (linenum) (*linenum)++;
+	while (((!options.abortable) || (!*options.abortable)) && loadSStringLine(f, buf))
+	{
+		if (options.linenum) (*options.linenum)++;
 		const char* t = buf.c_str();
 		p0 = t; while (isblank(*p0)) p0++;
@@ -448,6 +499,6 @@
 			case 0:
 				logPrintf("ParamInterface", "load", LOG_WARN, "Ignored unexpected line %s while reading object '%s'",
-					linenum ?
-					SString::sprintf("%d", *linenum).c_str()
+					options.linenum ?
+					SString::sprintf("%d", *options.linenum).c_str()
 					: SString::sprintf("'%s'", p0).c_str(),
 					getName());
@@ -472,6 +523,6 @@
 				{
 					fileinfo = SString::sprintf(" while reading from '%s'", fname);
-					if (linenum)
-						fileinfo += SString::sprintf(" (line %d)", *linenum);
+					if (options.linenum)
+						fileinfo += SString::sprintf(" (line %d)", *options.linenum);
 				}
 				logPrintf("ParamInterface", "load", LOG_WARN, "Multiple '%s.%s' fields found%s", getName(), id(i), fileinfo.c_str());
@@ -496,9 +547,9 @@
 					int ch; while ((ch = f->Vgetc()) != EOF) if (ch == '\n') break;
 					unquoteTilde(s);
-					if (linenum && (flags(i)&PARAM_LINECOMMENT))
-						s = SString::sprintf("@file %s\n@line %d\n", f->VgetPath(), *linenum + 1) + s;
+					if (options.linenum && (flags(i)&PARAM_LINECOMMENT))
+						s = SString::sprintf("@file %s\n@line %d\n", f->VgetPath(), *options.linenum + 1) + s;
 					set(i, s.c_str());
-					if (linenum)
-						(*linenum) += lfcount;
+					if (options.linenum)
+						(*options.linenum) += lfcount;
 				}
 				else
@@ -510,5 +561,5 @@
 			}
 		}
-		else if (warn_unknown_fields)
+		else if (options.warn_unknown_fields)
 		{
 			SString name(p0, p_len);
@@ -521,5 +572,5 @@
 			if (!readUntilTilde(f, s))
 				closingTildeError(this, f, -1);
-			if (linenum)
+			if (options.linenum)
 			{
 				const char* tmp = s.c_str();
@@ -530,5 +581,5 @@
 					lfcount++; tmp++;
 					}
-				(*linenum) += lfcount;
+				(*options.linenum) += lfcount;
 			}
 			int ch; while ((ch = f->Vgetc()) != EOF) if (ch == '\n') break;
@@ -705,5 +756,5 @@
 {
 	const char *t;
-	if (((*(t = type(i))) == 'd') && (strchr(t, '~')!=NULL)) //type is int and contains enum labels
+	if (((*(t = type(i))) == 'd') && (strchr(t, '~') != NULL)) //type is int and contains enum labels
 	{
 		paInt mn, mx, def;
@@ -1131,5 +1182,5 @@
 }
 
-int ParamInterface::load2(const SString &s, int &poz)
+int ParamInterface::loadSingleLine(const SString &s, LoadOptions &options)
 {
 	int i; // the index number of the parameter
@@ -1145,8 +1196,8 @@
 	SString tmpvalue;
 	bool parse_failed = false;
-	if (poz >= s.len()) return fields_loaded;
-	t = s.c_str() + poz;
-
-	lin = getline(s, poz, len); // all fields must be encoded in a single line
+	if (options.offset >= s.len()) return fields_loaded;
+	t = s.c_str() + options.offset;
+
+	lin = getline(s, options.offset, len); // all fields must be encoded in a single line
 	if (!len) return fields_loaded; // empty line = end
 	i = 0;
@@ -1241,5 +1292,6 @@
 #endif
 	}
-	return fields_loaded | (parse_failed ? LOAD2_PARSE_FAILED : 0);
+	if (parse_failed) options.parse_failed = true;
+	return fields_loaded;
 }
 
Index: cpp/frams/param/param.h
===================================================================
--- cpp/frams/param/param.h	(revision 704)
+++ cpp/frams/param/param.h	(revision 720)
@@ -28,5 +28,5 @@
 #define PARAM_NOSTATIC  256     //< (FramScript) don't access this member in a static object (ClassName.field)
 #define PARAM_CONST     512     //< (FramScript) constant value
-#define PARAM_CANOMITNAME 1024  //< affects Param::save2()/load2() - for example one-liners in f0 genetic encoding
+#define PARAM_CANOMITNAME 1024  //< affects Param::saveSingleLine()/loadSingleLine() - for example one-liners in f0 genetic encoding
 #define PARAM_DONTLOAD	  2048  //< Param::load() skips this field
 #define PARAM_NOISOLATION 4096  //< don't use proxy object in master/slave interactions
@@ -170,12 +170,21 @@
 	void quickCopyFrom(ParamInterface *src);
 
+	enum FileFormat { FormatMultiLine, FormatSingleLine }; // FormatJSON in the future?
+	struct LoadOptions {
+		bool warn_unknown_fields; bool *abortable; int *linenum; int offset; bool parse_failed;
+		LoadOptions() : warn_unknown_fields(false), abortable(NULL), linenum(NULL), offset(0), parse_failed(false) {}
+	};
+
 	int save(VirtFILE*, const char* altname = NULL, bool force = 0);
 	int saveprop(VirtFILE*, int i, const char* p, bool force = 0);
-	int load(VirtFILE*, bool warn_unknown_fields = true, bool *abortable = NULL, int *linenum = NULL);///< @return the number of fields loaded
-	int load2(const SString &, int &);///< @return the number of fields loaded (or'ed with LOAD2_PARSE_FAILED if a parsing error was detected)
+
+	int load(FileFormat format, VirtFILE*, LoadOptions *load_options = NULL);///< @return the number of fields loaded
+	int load(FileFormat format, const SString &, LoadOptions *load_options = NULL);///< @return the number of fields loaded
+protected:
+	int loadMultiLine(VirtFILE*, LoadOptions &options);///< @return the number of fields loaded
+	int loadSingleLine(const SString &, LoadOptions &options);///< @return the number of fields loaded
+public:
 
 	static const char* SERIALIZATION_PREFIX;
-	static const int LOAD2_PARSE_FAILED = (1 << 30); ///< this bit is set in return value from load2 if a parse error was detected while loading. usage: if (load2(...) & LOAD2_PARSE_FAILED) ...
-	static const int LOAD2_IGNORE_PARSE_FAILED = (~LOAD2_PARSE_FAILED); ///< bitmask to be used if the parsing error is to be ignored. usage: int number_of_loaded_fields=load2(...) & LOAD2_IGNORE_PARSE_FAILED;
 
 	static bool isValidTypeDescription(const char* t);
@@ -299,5 +308,5 @@
 
 	int isequal(int i, void* defdata);
-	void save2(SString&, void *defdata, bool addcr = true, bool all_names = true);
+	void saveSingleLine(SString&, void *defdata, bool addcr = true, bool all_names = true);
 
 	virtual void setDefault();
Index: cpp/frams/param/syntparam.cpp
===================================================================
--- cpp/frams/param/syntparam.cpp	(revision 704)
+++ cpp/frams/param/syntparam.cpp	(revision 720)
@@ -8,60 +8,54 @@
 #include <math.h>
 
-SyntParam::SyntParam(ParamEntry *init_pe,SString* autostr,bool handle_defaults_when_saving)
+SyntParam::SyntParam(ParamEntry *init_pe, SString* autostr, bool handle_defaults_when_saving)
 	:autostring(autostr)
 {
-Param::setParamTab(init_pe);
-pe=ParamObject::makeParamTab(this);
-Param::setParamTab(pe);
-if (handle_defaults_when_saving)
+	Param::setParamTab(init_pe);
+	pe = ParamObject::makeParamTab(this);
+	Param::setParamTab(pe);
+	if (handle_defaults_when_saving)
 	{
-	def_obj=ParamObject::makeObject(pe);
-	Param::select(def_obj);
+		def_obj = ParamObject::makeObject(pe);
+		Param::select(def_obj);
+		Param::setDefault();
+	}
+	else
+		def_obj = NULL;
+	obj = ParamObject::makeObject(pe);
+	Param::select(obj);
 	Param::setDefault();
-	}
-else
-	def_obj=NULL;
-obj=ParamObject::makeObject(pe);
-Param::select(obj);
-Param::setDefault();
-revert();
+	revert();
 }
 
 SyntParam::SyntParam(const SyntParam& src)
-	:Param(),autostring(src.autostring)
+	:Param(), autostring(src.autostring)
 {
-Param::setParamTab(src.pe);
-pe=ParamObject::makeParamTab(this);
-Param::setParamTab(pe);
-obj=ParamObject::dupObject(src.obj);
-def_obj=src.def_obj ? ParamObject::dupObject(src.def_obj) : NULL;
-Param::select(obj);
+	Param::setParamTab(src.pe);
+	pe = ParamObject::makeParamTab(this);
+	Param::setParamTab(pe);
+	obj = ParamObject::dupObject(src.obj);
+	def_obj = src.def_obj ? ParamObject::dupObject(src.def_obj) : NULL;
+	Param::select(obj);
 }
 
 SyntParam::~SyntParam()
 {
-update();
-ParamObject::freeParamTab(pe);
-ParamObject::freeObject(obj);
-ParamObject::freeObject(def_obj);
+	update();
+	ParamObject::freeParamTab(pe);
+	ParamObject::freeObject(obj);
+	ParamObject::freeObject(def_obj);
 }
 
 void SyntParam::update(SString *s)
 {
-if (!s) s=autostring;
-if (s) {*s=""; Param::save2(*s,def_obj,0);}
+	if (!s) s = autostring;
+	if (s) { *s = ""; Param::saveSingleLine(*s, def_obj, 0); }
 }
 
 void SyntParam::revert(SString *s)
 {
-if (!s) s=autostring;
-if (s)	{
-	int p=0;
-	Param::load2(*s,p);
+	if (!s) s = autostring;
+	if (s)	{
+		Param::load(ParamInterface::FormatSingleLine, *s);
 	}
 }
-
-
-
-
-
