2 messages in org.openoffice.fr.progOOo 2.0.3 - Les paramètres optionnel...
FromSent OnAttachments
Ludovic CHEVALIERJul 20, 2006 7:05 am 
Bernard MarcellyJul 21, 2006 12:39 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:OOo 2.0.3 - Les paramètres optionnels des fonctionsActions...
From:Ludovic CHEVALIER (tens@no-log.org)
Date:Jul 20, 2006 7:05:40 am
List:org.openoffice.fr.prog

Bonjour,

J'appelle depuis mon programme principal une fonction dont deux paramètres sont optionnels. Or, j'ai un petit souci. Ma fonction donne systématiquement la valeur "Error ?€" au premier paramètre si il est manquant. Un IsMissing sur ce paramètre renvoie donc "true".

Je vous propose ce progamme en exemple.

Sub Main Identite(,"CHEVALIER") End Sub

Function Identite(Optional Prenom as String, Optional Nom as String) If IsMissing(Prenom) then Prenom = "Pas de Pr??nom" End if MsgBox(Prenom & chr(13) & Nom) End Function

Ludo