I agree. putvar and getvar and poorly implemented, supposedly for speed. I can't even store a 8 digit int YYYYMMDD using putvar because the printf used to write it to text file has limited float resolution.

Now it goes into the Windows registry? - Oy vey! Who's bright idea that? All we need is more junk in the Windows registry.

Better to store as string and use a faster computer :-)

I had to write my own getstr and putstr. For what it's worth, here it is

Code

string mygetstr(string fName, string itemName)
{
	string content = file_content(fName);
	if (!content) return 0;
	
	string myitem = strtext(content,strf("%s,",itemName),"0");
	if (!myitem) return 0;
	
	return myitem;
	
}

int myputstr(string fName, string itemName, string newval)
{
	string content = file_content(fName);
	if (!content) return 0;

	if (strstr(content,strf("%s,",itemName)))	{
		string myitem = strtext(content,strf("%s,",itemName),"0");
		if (!myitem) return 0;
			
		string old2 = strf("%s,%s",itemName,myitem);
		string newval = strf("%s,%s",itemName,newval);
		
		content = strx(content,old2,newval);
		file_write(fName,content,0);
	}
	else			
		file_append(fName,strf("%s,%s\n",itemName,newval));
}

var mygetvar(string fName, string itemName){
	return (atof(mygetstr(fName, itemName)));
}

function myputvar(string fName, string itemName, var val) {
	myputstr(fName, itemName,strf("%.3f",val));
}