PC SOFT
ONLINE REPOSITORY
FOR WINDEVWEBDEV AND WINDEV MOBILE

Home |  | Sign in | English US
WD Calculating the date of Easter and an age - WD Calculando a data da Páscoa e uma idade - Gregorian calendar - Calendário Greg
Published by Boller
- Unclassified
New features



Description
WD Calculating the date of Easter and an age - WD Calculando a data da Páscoa e uma idade

sMyAge is string // Retrieves the age

// calculate the age according to the reference date
sMyAge = Age(EDT_Date_of_birth,EDT_ReferenceDate)
// display the age
STC_Tc_age1 = StringBuild("Age of %1 years, %2 months and %3 day(s)",Val(Left(sMyAge,4)),Middle(sMyAge,5,2),Right(sMyAge,2))


//---------------------------------------------- Páscoa

sDayInLetter is string // the day of Easter in letters
sMonthInAlpha is string // the month of Easter in letters
sDay is string // the day of Easter in digits

IF MySelf > 1582 AND MySelf < 9999 THEN
sDayInLetter = DateToDayInAlpha(Easter(MySelf))
sMonthInAlpha = DateToMonthInAlpha(Easter(MySelf))
sDay = Right(Easter(MySelf),2)

// build the date of Easter in letters
sEasterDayInLetter is string = sDayInLetter+" "+sDay+" "+sMonthInAlpha+" "+NumToString(MySelf)
// Display
STC_TC_EasterDay1 = StringBuild("The day of Easter for the year %1 is %2",MySelf,sEasterDayInLetter)
ELSE
// limitations
Info("The calculation year must be greater than 1582 (Gregorian calendar) and less than 9999: ","otherwise the ""Easter"" function returns empty string.")
END


//------------------------------------------------------------------------------------------------------------------------------------


WD Calculando a data da Páscoa e uma idade - WD Calculando a data da Páscoa e uma idade

sMyAge is string // Recupera a idade

// calcula a idade de acordo com a data de referência
sMinhaIdade = Idade(EDT_Date_of_birth,EDT_ReferenceDate)
//exibe a idade
STC_Tc_age1 = StringBuild("Idade de %1 anos, %2 meses e %3 dia(s)",Val(Left(sMyAge,4)),Middle(sMyAge,5,2),Right(sMyAge,2))


//--------------------------------------------- Páscoa

sDayInLetter é string // o dia da Páscoa em letras
sMonthInAlpha é string // o mês da Páscoa em letras
sDay é string // o dia da Páscoa em dígitos

IF MySelf > 1582 AND MySelf < 9999 THEN
sDayInLetter = DateToDayInAlpha(Páscoa(MySelf))
sMonthInAlpha = DateToMonthInAlpha(Páscoa(MySelf))
sDia = Direita(Páscoa(Eu),2)

// constrói a data da Páscoa em letras
sEasterDayInLetter é string = sDayInLetter+" "+sDay+" "+sMonthInAlpha+" "+NumToString(MySelf)
// Exibição
STC_TC_EasterDay1 = StringBuild("O dia da Páscoa para o ano %1 é %2",MySelf,sEasterDayInLetter)
SENÃO
// limitações
Info("O ano de cálculo deve ser maior que 1582 (calendário gregoriano) e menor que 9999: ","caso contrário, a função ""Páscoa"" retornará uma string vazia.");
FIM
Illustrations, screen shots
none
none
User reviews
(To evaluate this resource, click 'Write a review')
No review or comment? Be the first one!