Index: /cpp/frams/Makefile-SDK
===================================================================
--- /cpp/frams/Makefile-SDK	(revision 516)
+++ /cpp/frams/Makefile-SDK	(revision 517)
@@ -5,5 +5,5 @@
 include frams/Makefile-SDK-files
 
-SDK_TESTS=genoconv_test genomanipulation geno_test genooper_test genooper_test_fTest neuro_test loader_test loader_test_param serial_test multiline_f0_test f0_variants_test full_props shapeconvert part_shapes neuro_layout_test geometry_apices_test geometry_info_test geometry_surface_test geometry_volume_test simil_test simil_unittests
+SDK_TESTS=genoconv_test genomanipulation geno_test genooper_test genooper_test_fTest neuro_test loader_test_geno loader_test_param saver_test_geno serial_test multiline_f0_test f0_variants_test full_props shapeconvert part_shapes neuro_layout_test geometry_apices_test geometry_info_test geometry_surface_test geometry_volume_test simil_test simil_unittests
 
 sdk_tests: $(SDK_TESTS)
@@ -44,9 +44,12 @@
 	$(CXX) $(NEURO_TEST_OBJS) $(LDFLAGS) -o $@
 
-loader_test: $(LOADER_TEST_OBJS)
+loader_test_geno: $(LOADER_TEST_OBJS)
 	$(CXX) $(LOADER_TEST_OBJS) $(LDFLAGS) -o $@
 
 loader_test_param: $(LOADER_TEST_PARAM_OBJS)
 	$(CXX) $(LOADER_TEST_PARAM_OBJS) $(LDFLAGS) -o $@
+
+saver_test_geno: $(SAVER_TEST_OBJS)
+	$(CXX) $(SAVER_TEST_OBJS) $(LDFLAGS) -o $@
 
 serial_test: $(SERIAL_TEST_OBJS)
Index: /cpp/frams/Makefile-SDK-files
===================================================================
--- /cpp/frams/Makefile-SDK-files	(revision 516)
+++ /cpp/frams/Makefile-SDK-files	(revision 517)
@@ -36,7 +36,9 @@
 F0_VARIANTS_OBJS=frams/_demos/f0_variants_test.o common/virtfile/stringfile.o $(STDOUT_LOGGER_OBJS) $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
 
-LOADER_TEST_OBJS=frams/_demos/genotypeloader.o frams/_demos/loader_test.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
+LOADER_TEST_OBJS=frams/_demos/genotypeloader.o frams/_demos/loader_test_geno.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
 
 LOADER_TEST_PARAM_OBJS=frams/_demos/loader_test_param.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(STDOUT_LOGGER_OBJS) $(SDK_OBJS)
+
+SAVER_TEST_OBJS=frams/_demos/genotypeloader.o frams/_demos/saver_test_geno.o common/virtfile/virtfile.o frams/param/multiparamload.o common/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
 
 GENOCONV_TEST_OBJS= frams/_demos/genoconv_test.o frams/_demos/printconvmap.o $(STDOUT_LOGGER_OBJS) $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
Index: /cpp/frams/_demos/genotypeloader.h
===================================================================
--- /cpp/frams/_demos/genotypeloader.h	(revision 516)
+++ /cpp/frams/_demos/genotypeloader.h	(revision 517)
@@ -32,5 +32,5 @@
     the Framsticks genotype file.
 
-    Usage pattern: (see loadertest.cpp for the working code)
+    Usage pattern: (see loader_test_geno.cpp for the working code)
 
     1.Initialize
Index: /cpp/frams/_demos/saver_test_geno.cpp
===================================================================
--- /cpp/frams/_demos/saver_test_geno.cpp	(revision 517)
+++ /cpp/frams/_demos/saver_test_geno.cpp	(revision 517)
@@ -0,0 +1,52 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#include "genotypeloader.h"
+#include <common/virtfile/stdiofile.h>
+
+/**
+ @file
+ Sample code: Saving genotypes
+
+ \include saver_test_geno.cpp
+*/
+
+int main(int argc,char*argv[])
+{
+if (argc<3)
+	{
+	fprintf(stderr,"Arguments: filename number_of_genotypes\n"
+	     "Example: saver_test_geno file.gen 3\n"
+		);
+	return 1;
+	}
+
+StdioFileSystem_autoselect stdiofilesys;
+VirtFILE *f=Vfopen(argv[1],"w");
+if (f)
+	{
+	int N=atoi(argv[2]);
+	MiniGenotype g;
+	Param p(minigenotype_paramtab,&g);
+	g.clear();
+	printf("Saving %d genotypes to %s\n",N,argv[1]);
+	for(int i=1;i<=N;i++)
+		{
+		g.name=SString::sprintf("Genotype#%d",i);
+		g.genotype=""; for(int x=0;x<i;x++) g.genotype+="X";
+		g.velocity=0.1*i;
+		g.energy0=1;
+		g.info="Saved by saver_test_geno.cpp";
+		g.is_valid=1;
+		p.save(f,"org");
+		}
+	delete f;
+	return 0;
+	}
+else
+	{
+	printf("Could not write to %s\n",argv[1]);
+	return 1;
+	}
+}
