51 routines :

*AppleScriptsVanilla*
ascii_to_HTML
Average
Calculator
Calendar
Count_item
cut_text
days_week
EAN13
Encrypt-Decrypt
FactPremier
French_Vanilla_Dotted_Date
French_Vanilla_Dotted_Date2
Hexa_to_Bin
Last_month
list_erase
list_insert
list_replace
ListeDiviseurs
ListePremiers
Minuscule
NombreLong
NombreLong2
NomExtension
num_item
num_month
num_month2
num_week
number_format
number_format2
Paques
PGCD
PGCD2
reverse_string
Roman_to_Arab
round_decimal
search_email
search_replace
search_URL
SepNbre
SepNbre2
snip_text
stat
TauxPermut
TauxTransform
the_left
the_right
TriBulle
TriLineaire
week_and_year
XOR
ZeroDouble

Calendar

Syntaxe

Calendar(the_month, the_year)
Crée un calendrier mensuel.
Les paramètres sont au format nombre, le résultat est au format texte.
Par Fredo d;o)

Exemple

Calendar(10, 2002)
--->
" Octobre 2002
Lun Mar Mer Jeu Ven Sam Dim
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31"

Script

on Calendar(the_month, the_year)
set days_Uk to "MonTueWedThuFriSatSun"
set List_Mois_Fr to {"Janvier", "Février", "Mars", "Avril", "Mai", ¬
"Juin", "Juillet", "Aožt", "Septembre", "Octobre", "Novembre", "Décembre"}
set List_num_Mois to {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
set Infos_Cal to ("" & tab & (item the_month of List_Mois_Fr) & " " & the_year & return & ¬
tab & "Lun" & tab & "Mar" & tab & "Mer" & tab & "Jeu" & ¬
tab & "Ven" & tab & "Sam" & tab & "Dim" & return) as text
set day_week to (weekday of (date ("1/" & the_month & "/" & the_year)))
set num_day_week to (offset of (text 1 thru 3 of (day_week as text)) in days_Uk) div 3 + 1
set num_day to item the_month of List_num_Mois

if (the_month is 2) and ((the_year mod 4) is 0) then set num_day to 29
set {num_day, num_day_text, the_Cal, num_loop} to ¬
{0, tab, {}, (num_day_week + num_day - 1)}

repeat with the_loop from 1 to num_loop
if (the_loop e" num_day_week) then set num_day to num_day + 1
if (num_day > 0) then set num_day_text to (tab & num_day) as text
if (the_loop > 1) and (the_loop < num_loop) and ((the_loop mod 7) = 0) then ¬
set num_day_text to (num_day_text & return)
set end of the_Cal to num_day_text
end repeat

return (Infos_Cal & the_Cal) as text
end Calendar

Remarque

Utilise num_week.

Site scripté avec HyperCard ©1987-1998 Apple Computer, Inc.
Mise à jour le 19/01/10 à 08:45:57