5 messages in org.openoffice.fr.progRe: [prog] Bug avec "Redim preserve" ...
FromSent OnAttachments
FabienOct 16, 2008 3:45 pm 
FabienOct 16, 2008 11:09 pm 
FabienOct 16, 2008 11:41 pm 
Francois GattoOct 16, 2008 11:47 pm 
FabienOct 17, 2008 1:57 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:Re: [prog] Bug avec "Redim preserve" dans OOo3Actions...
From:Fabien (fabs@wanadoo.fr)
Date:Oct 16, 2008 11:41:57 pm
List:org.openoffice.fr.prog

Je me réponds à moi-même. En fait, ce qui pose problème dans mes exemples n'est pas "Redim preserve" mais la fonction Array, qui renvoie un variant et non une chaîne. Idem si l'on emploi "split" pour créer un tableau. Redim ne marchera pas.

Exemple (j'aime bien les exemples!): Ceci marche:

Sub test dim st(2) as string st(0) = "a" ReDim preserve st(1) as String print st(0) end sub

Ceci ne marche pas:

Sub test dim st(2) as string st = split("a,b,c",",") print st(0) print typeName(st) 'Renvoie "Variant" et non "String()" ReDim preserve st(1) as String st(0) = "a" print st(0) print typeName(st) end sub

Bug donc moins gênant que je ne le pensais initialement, reste que de mon point de vu, ce comportement n'est pas normal...