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

snip_text

Syntaxe

SnipText(Txt, Long)
Tronque un texte selon un nombre de caractères pré-définis. Le texte à couper (Txt) est au format texte, le nombre de caractères à respecter (Long) est au format nombre. Le résultat est au format texte. "Long" doit être supérieur à 4.
Par Fredo d;o)

Exemple

SnipText("Nom très, trop long pour un petit document.doc", 31)
---> "Nom très, trop...tit document.doc"

Script

on SnipText(Txt, Long)
if (length of Txt) > Long then ¬
return (text 1 thru ((Long div 2) - 1) of Txt) ¬
& "..." & (text -1 thru -((Long div 2) + 1) of Txt)
end SnipText

Remarque

Les 3 points de suspension doivent être obtenu avec "alt point-virgule" pour être considéré comme un seul caractère.
Exemple d'utilisation : Nommer les éléments sous MacOs 9 sans dépasser les 31 caractères autorisées.

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