DÉFINIT UNE OU PLUSIEURS VARIABLES À L'INTÉRIEUR D'UN SOUS-PROGRAMME OU D'UNE FONCTION
ACTION
La commande définit une ou plusieurs variables, simple ou en tableau.
Un nom de variable peut contenir des lettres, le caractère souligné ("_") ou des chiffres, mais le premier caractère doit être une lettre.
Une variable peut être de l'un des 3 types : entier, réel, string.
Le type d'une variable est défini par le dernier caractère de son nom :
% pour une variable entière
$ pour une variable string
Ni % ni $ pour une variable réelle
Un tableau est défini par son nombre maximal d'éléments.
SYNTAXE :
DIM_LOCAL V1[,Vn]
UTILISATION ERREUR EXEMPLE
dim a%(20),i%
for i%=1 to 10:a%(i%)=i%:next i%
for i%=1 to 10
imprime(a%(i%))
next i%
end
sub imprime(j%)
dim_local a%(20),i%
for i%=1 to 10:a%(i%)=100:next i%
print j%
end_sub
DIM_LOCAL
DIM_LOCAL V
EN RAPPORT
ADR()
DIM
FREE