Make your own free website on Tripod.com

 

Home Creations

Great Palm OS™ software. Everything else is irrelevant.


FAQ.

This FAQ is intended to help developer's with some tips, some links, and some source code :)

Feel free to use it, comment on it, and give any suggestions you like. This FAQ was started on 8 Aug. So it's still just "begun". For a good newsgroup, use the server news.falch.net

  1. How do I select the day from the day picker? (I get "object not in form" error!)
  2.  I keep getting "stack overflow" error and it shows me a whole list of functions .. I'm clueless!

Q1. How do I select the day from the day picker? (I get "object not in form" error!)

A. SelectDay requires you to have valid values for day, month and year. An oft-repeated mistake is to send un initialized values to the function. Here's some simple source that helps you call the picker, and assign a simple formatted return value to a field. The input dtype will contain the selected values. The Char * is a value you could use to set in a label or field. (There are ways this code can be optimized and made to perform other functions - but then that's left to you.)

Char *GetDateFromPicker(SelectDayType dp,Char *title,DateType *dtype)
{
	Int16 day,month,year;
	DateTimeType dt;
	Char *strdate = NULL;
	TimSecondsToDateTime(TimGetSeconds() ,&dt);
	
	day = dt.day; month = dt.month; year = dt.year;
	
	if (SelectDay(dp,&month,&day,&year,title) )
	{
		strdate = (char *)GetNewStr(11*sizeof(Char));	
		dtype->year = year - 1904;
		dtype->month = month;
		dtype->day = day;

		StrPrintF(strdate,"%d/%d/%d",month,day,year);
	}
	return strdate;
}

Q2. I keep getting "stack overflow" error and it shows me a whole list of functions .. I'm clueless!

A. Stack sizes on Palm are low (about 2K it appears) so take a look at your code - and eliminate large static allocations. E.g. char s[2000] or a large array of structures etc. This should typically solve your problem. The key is make as many dynamic allocations and free them as opposed to making static allocations.

 

(c) homecreations, 2001-2002. All sample downloads and final products are sold on the condition that at no circumstance shall homecreations be held responsible for any kind of damage or harm caused by the software. There are no implied warranties and you are wholly responsible for all eventualities. God, what legal crap do we have to print to save ourselves.

homepalm@hotmail.com