Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Beginner Q: control/call for date picker...

Beginner Q: control/call for date picker...

Discuss OrbForms Designer and PocketC Architect

Postby steveK on Mon Aug 13, 2007 2:13 pm

Hi Dewey and All,

This will be an easy question for you guys: How do I work with dates? For example if I wanted to calculate a person's age via diffdays (today-dateofBirthVar)/365.25 or some such thing (I know that's not the correct syntax). I see from the Help that there's a data.date and there are references to string date(). I don't see in the manual any variable of type "date."

Are dates 'stored' as Strings? as Integers?
What control do I use to call the date picker at run-time? Is it a gadget? Is there a 'sample app' that employs this? I didn't see one in the download package.

Sorry if this is a real no-brainer. If someone can even direct me to the correct portions of the manual, it would be very helpful.

Much thanks. :)
steveK
 
Posts: 16
Joined: Mon Aug 21, 2006 12:11 am

Postby Percival on Mon Aug 13, 2007 5:52 pm

Hi

There is a Date object. See "Library Reference -> System -> Date" in the documentation.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by steveK</i>
<br />
What control do I use to call the date picker at run-time?
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Can be found in the help section about the Date object. Use this to display the system date selector dialog.
Code: Select all
bool selectdate(int selby, string title)


Hope this helps.
Percival
 
Posts: 45
Joined: Sat Jul 19, 2003 10:31 am
Location: Netherlands

Postby steveK on Tue Aug 14, 2007 3:11 pm

Hi Percival,

Thanks, again, for the reply. I actually *did* see
bool selectdate(int selby, string title)
in the manual, but dismissed it thinking it couldn't possibly return a date (given that it's a "boolean" method).

Anyway, I have an OrbForm with a single button. My handler is thus:

//handler push1003.onselect() {
// bool selectdate(int dateDayByMonth, string "mytitle")
//}
I figure I'll get the date picker going, THEN worry about manipulating the date. I'm apparently using the above statement incorrectly, because I keep getting compiler error "error in declaration" at the location between "selectdate" and "(." I've tried pre-declaring the variables and a couple of other permutations, but no luck --- any thoughts?

Much thanks. :) -steve
steveK
 
Posts: 16
Joined: Mon Aug 21, 2006 12:11 am

Postby Percival on Tue Aug 14, 2007 3:35 pm

Hi again,

How familiar are you with object oriented programming? The selectdate method is from the Date object. Example usage:
Code: Select all
handler push1003.onselect() {
Date date;

date.selectdate(dateDayByMonth, "mytitle");
alert(date.date());
}


To manipulate dates, you can assign values to the Date object properties.
Code: Select all
Date date;

date.year = 2007;
date.month = 8;
date.day = 14;
Percival
 
Posts: 45
Joined: Sat Jul 19, 2003 10:31 am
Location: Netherlands

Postby steveK on Sat Aug 18, 2007 3:13 pm

Hi Percival,

I just wanted to say thanks. The sample code works like a charm. I'm not at all experienced with OO programming, though I've read a little about it. I noticed your code contains "date date." I guess this is where the "date object" is declared sort of like a variable is declared. I remember reading in the OrbManual that the OrbRuntime basically treats objects as variables--so this all makes sense. (sort of)

I also found a previous thread http://pocketc.net/forum/topic.asp?TOPIC_ID=4160 that deals with manipulating dates. I'm dissecting that too. Off I go--wish me luck !! :D
steveK
 
Posts: 16
Joined: Mon Aug 21, 2006 12:11 am


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests

cron