aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1052

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1052  ShareCODE: fechas.ibas

13/01/2005 @ 02:56
by Montalvo

Anonymous



Hi!

This was my first approach using izibasic to create a small application for palmos.

'Fechas.ibas' lets you calculate the differente in days between two specific dates, and also calculate Julian Day for each date.

- - - CUT HERE - - -
'fechas.ibas
{CreatorID "mCoB"}
{parser on}
{resourcefile "dos.rcp.txt.ro"}

const x$­­­="Programa creado con¶izibasic 4.0¶"
const y$­­­="MComm/TuPalMX¶"
const z$­­­="info@tupalmx.com"
aboutbox x$­­­+y$­­­+z$­­­

Begin
'encabezados
setfont 7
label #1,"Calcula Diferencia",29,23
label #4,"Dias Julianos",42,73
label #8,"Diferencia",50,110
'botones
setfont 0
button#2,"Fecha INI",20,45,50,10
f$­­­=date$­­­
t$­­­=f$­­­
gosub _juliano
i$­­­=trim$­­­(h$­­­)
button#5,"Fecha FIN",100,45,50,10
g$­­­=date$­­­
t$­­­=g$­­­
gosub _juliano
j$­­­=trim$­­­(h$­­­)

repeat
'julianos
label #20,i$­­­,20,90
label #21,j$­­­,100,90
box 1,71 to 159,106
'fechas
label #3,f$­­­,20,58
label #7,g$­­­,100,58

gosub _calcula

x=doevents
if x=2 then
f$­­­=dateselect$­­­(f$­­­)
t$­­­=f$­­­
gosub _juliano
i$­­­=trim$­­­(h$­­­)
end if
if x=5 then
g$­­­=dateselect$­­­(g$­­­)
t$­­­=g$­­­
gosub _juliano
j$­­­=trim$­­­(h$­­­)
end if
until x=-1

_juliano:
a$­­­=right$­­­(t$­­­,4)
a=val(a$­­­)
m$­­­=mid$­­­(t$­­­,4,2)
m=val(m$­­­)
d$­­­=left$­­­(t$­­­,2)
d=val(d$­­­)
'conversion
e=(14-m)/12
f=a+4800-e
g=m+(12*e)-3
h=d+(((153*g)+2)/5)+(365*f)+(f/4)-(f/100)+(f/ 400)-32045
h$­­­=str$­­­(h,0)
return

_calcula:
'calcula diferencia
k=val(i$­­­)-val(j$­­­)
k=abs(k)
k$­­­=str$­­­(k,0)+" Dia(s)"
setfont 2
label #22,k$­­­,53,130
setfont 0
return

End

- - - CUT HERE - - -

You can find this application, the sourcecode (in DOC format) and the resource file (for the icon), here:

http://tupalmx.com/clickcount/click.php?id=20

Greetings from México!
Write to Montalvo   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
13/01/2005 @ 10:42
by aldweb

Anonymous

visitor
Hello Montalvo,

It is very nice of you to share your source code this way.
Advice: next time, use the P button to put it in "preformated text" which is a special mode for source code. I did it for you, doesn't your source code look much nicer?

And, as from the download link you provided, I did a quick search on tupalmx.com which I found to be a very nice blog, and I found this one:
http://tupalmx.com/index.php?misc=search&ucat=1&subaction=showfull&id=1085902659&archive=1086682017&cnshow=news&start_from=&

Thank you!


@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2
--------
13/01/2005 @ 12:06
by Khertan

Anonymous

visitor
i ll put my own diff date algo in few day ... but you re more fast than me :)
Write to Khertan   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^