Ariane Soft PPL2 Pocket Programming DataMite
  #1  
Old 03-06-2010, 07:41 AM
Unrealbots Unrealbots is offline
Junior Member
 
Join Date: Feb 2010
Posts: 15
Smile Time & Date

Hello Programmers,

1) I am new to PPL and was trying to find a control for a timer to make a clock. Does anyone know if it has a control for timers?

2) Does anyone have any code snippets for the tides, moon phases, seasons or sunrises?

3) Does anyone know if there are controls for layers or for drawing lines like in Visual Basic?

Or can you point me towards a good tutorial on PPL or BASIC, C or PASCAL programming...

Cheers

Unrealbots

Last edited by Unrealbots; 03-06-2010 at 10:30 AM.
Reply With Quote
  #2  
Old 03-06-2010, 10:08 AM
Unrealbots Unrealbots is offline
Junior Member
 
Join Date: Feb 2010
Posts: 15
Default Time and Date Application.zip

Is it possible for someone to suggest how to make my code more efficient and effective like using calls to sub procedures.

Cheers
Attached Files
File Type: zip Time and Date Application.zip (29.4 KB, 163 views)

Last edited by Unrealbots; 03-06-2010 at 10:42 AM.
Reply With Quote
  #3  
Old 03-06-2010, 09:45 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

hi,
so you found the old clock example yourself
my only hint for your code here:
make a global variable for the struct SYSTEMTIME and reuse it instead of initializing it everytime.
oh and you can replace..
PHP Code:
date$ = s$;
SetText(lblDateData$, data$); 
with..
PHP Code:
SetText(lblDateData$, s$); 
Reply With Quote
  #4  
Old 03-10-2010, 07:36 AM
Unrealbots Unrealbots is offline
Junior Member
 
Join Date: Feb 2010
Posts: 15
Default

Hi Nicknack,

is it possible to give a code snippet example of what you said? or does no-one on this forum actually help people with code, as I've read elsewhere on this forum.



"make a global variable for the struct SYSTEMTIME and reuse it instead of initializing it everytime."
Reply With Quote
  #5  
Old 03-10-2010, 06:57 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

where do you read this?
of course I can here it is, I made several other modification. not sure what do you want to achieve with the settimer in frmTemplate_OnCreate so I left it out.
Attached Files
File Type: txt time.txt (5.6 KB, 164 views)
Reply With Quote
  #6  
Old 04-06-2010, 10:03 AM
Unrealbots Unrealbots is offline
Junior Member
 
Join Date: Feb 2010
Posts: 15
Default

Hey Nicknack,

Thanks for your new code. I've tried to run it but everytime i run the ppl file the .frm file changes the code you made.

I'm trying to write an application with '4 world clocks', and the newest code is below this text. However there are two problems:-

1. Clock is two hours forward then the timezone here in Sydney Australia.

2. Also how do I set the timezones for Los Angeles & New York?

Any help is appreciated.

Thanks

Unrealbots

Last edited by Unrealbots; 04-06-2010 at 08:35 PM. Reason: Spelling mistakes
Reply With Quote
  #7  
Old 04-06-2010, 10:16 AM
Unrealbots Unrealbots is offline
Junior Member
 
Join Date: Feb 2010
Posts: 15
Default

World_Clock.zip (3.9 KB)
Attached Files
File Type: zip World_Clock.zip (3.9 KB, 131 views)
Reply With Quote
  #8  
Old 04-07-2010, 11:22 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

read on msdn about the functions GetTimeFormat, GetDateFormat and GetTimeZoneInformation. it seems you can get the time for any given timezone, maybe it solves your other problem, too.
Reply With Quote
  #9  
Old 04-08-2010, 09:51 AM
c4esar c4esar is offline
Member
 
Join Date: Mar 2009
Location: Germany
Posts: 41
Default

Hi!
I just tested your code and the clocks are 2 hours behind the local time here in Germany. I suppose it's Greenwich-time, so your clocks actually aren't two hours forward, but ten hours behind Sidney.

But when I replace GetSystemTime with GetLocalTime it works fine.

You could remove the code-lines in the init-Section of your form, you don't need them.

To access all the different TimeZones there are two ways:
#1) there's a GetSystemTimeZones-function, but I can't figure out how to use it - perhaps Nicknack or kornalius can help you with that
#2) there are free TimeZone-Databases at http://www.twinsun.com/tz/tz-link.htm ..you could simply use one of them with a textfile or a SQLite-Database.
#3)there's a list of the Windows TimeZone-Indexes at http://msdn.microsoft.com/en-us/library/ms912053.aspx
and a very helpful article at http://blogs.msdn.com/bclteam/archiv...josh-free.aspx


greetings, c4esar

Last edited by c4esar; 04-08-2010 at 04:34 PM.
Reply With Quote
  #10  
Old 06-09-2010, 12:41 PM
Unrealbots Unrealbots is offline
Junior Member
 
Join Date: Feb 2010
Posts: 15
Default Time and Date Application Need Help Still...

Hi c4esar,
Thanks for the help...however I have looked at the links you suggested and cannot find the timezones code I need...

Is there anyone on the forum who knows the code for timezones?

Below is my current version of the application in its basic form until i can workout the timezones issue...
Attached Files
File Type: zip Clock_Australian_UK_Stockmarket.zip (37.1 KB, 121 views)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:11 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.
Copyright © 2009 www.ppl-lang.com - All rights reserved
Web Design by BR Web Consulting Ltd