13/01/2005 @ 02:56 by Montalvo
|
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!
|