aldweb

Fermer I. aldweb

Fermer II. Gratuitiels PC

Fermer III. Gratuitiels Palm

Fermer IV. Partagiciels Palm

Fermer V. iziBasic Palm

Fermer VI. Connaissance Palm

Fermer VII. Ordinateur Poche

Fermer VIII. miniPortail

Spécial !



Version mobile
de l'aldweb Site

m.aldweb.com


Ni Français, ni Anglais ?

Essayez donc l'un de ces drapeaux :
[de] [es] [it] [pt]
Recherche




Météo / Spam / www

Météo Lyon


aldweb contre le SPAM


Newsletter
Pour avoir des nouvelles de ce site, inscrivez-vous à notre Newsletter.
S'abonner
Se désabonner
298 Abonnés
Sites web de la famille

Webmaster - Infos
News Amis
Visites

   visiteurs

   visiteurs en ligne

Sondage
Comment trouve-tu le nouvel habillage de l'aldweb Site ?
 
Superbe !
Joli
Moyen
Moche...
Résultats
forum.gifForum - iziBasic - Sujet n°1052

Forum - Forum
iziBasic - iziBasic


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

actif  Sujet n° 1052  ShareCODE: fechas.ibas

le 13/01/2005 @ 02:56
par Montalvo

Anonyme



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!
Ecrire à Montalvo   Poster une réponse  Haut

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

Anonyme

visiteur
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
Ecrire à aldweb   Poster une réponse  Haut

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

Anonyme

visiteur
i ll put my own diff date algo in few day ... but you re more fast than me :)
Ecrire à Khertan   Poster une réponse  Haut
actif sujet actif   clos sujet clos   Important! Important!   Nouveau Nouveau message   -   Rectifier Rectifier message   Clôturer Clôturer sujet   Remonter Remonter
[]
Catégories de discussion  Forum 



 
^ Haut ^