bonjour
Le code suivant ==-->marche bien mais je voulais vous demander quelque chose;
j'utilise dans mon programme des tableaux de dimension fixe (999), j'ai cherché dans msdn comment utiliser les tableaux comme arguments de fonction, mais j'ai trouvé seulement un exemple avec les tableaux dynamiques. j'ai essayé alors la syntaxe suivante qui n'a pas marché
Code : Sélectionner tout - Visualiser dans une fenêtre à part
Private Function virg_to_point(tbl(999) As Single) As String(999)
j'ai donc utilisé le tableau dynamique tstr() (l'appel de la fonction sauver est comme suit (y est de dimension fixe)
bon, brièvement je voulais savoir l'utilisation des tableaux comme paramètres pour les procédures
==-->
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
32
33
34
35
36
37
38
39
40
Private Function virg_to_point(tbl() As Single) As String()
   Dim tble(999) As String
   Dim inte As Integer
 
   For inte = 0 To h
   tble(inte) = Str(tbl(inte))
  ' tble(inte) = Replace(tble(inte), ",", ".")
   Next inte
 
   virg_to_point = tble
 
End Function
 
Private Sub sauver(itbl() As Single, nmfish As String)
Dim jt As Integer
Dim tstr() As String
h = k
Form6.Caption = h
dos1 = chemin & nmfish & ext
If Not (DirExists(chemin)) Then
MkDir chemin
End If
newfich (dos1)
 
'!!!!!!!!!!!!!!!!!!!!!**************************************
numfich = FreeFile
Open dos1 For Output As #numfich
'Print #numfich, Timer1.Interval
tstr = virg_to_point(itbl)
For jt = 0 To h
Print #numfich, tstr(jt)
Next jt
Close #numfich
If FileExists(chemin & nmfish & ".mat") Then
Kill chemin & nmfish & ".mat"
End If
Name dos1 As chemin & nmfish & ".mat"
''
'''''''''''''''''''''''
End Sub
encore