OVH Cloud OVH Cloud

Petit probleme de type vs tableau dinamique

6 réponses
Avatar
Himselff
Cest bien simple comme probleme, jai un type tableau que jai creer, par
contre je ne peux linitialiser tout de suite car il est dinamique donc je ne
peux que linitialiser apres avoir rouler une certaine procedure , je ne
comprend pas comment je pourrais declarer tout sa pour que mon tableau soit
accessible de partout dans mon module!

voici mes declarations !

'**************************************************************
'Type that will allow me to classified each roll of every kind
'**************************************************************
Type Mon_Tableau
Longueur As Integer 'YD2
noRoll As String 'Roll number
noIndex As Integer 'Key in the database
patron As Integer 'Pattern number
satisfaction As Boolean 'Variable that say if that roll as been
choosen
End Type

'**********************************************************************
'Variable that is goiing to be my 6 foot and 12 foot array
'***********************************************************************
Dim tableauSix As String 'All six foot roll information
Dim tableauTwelve As String 'All twelve foot roll information

et plus bas dans ma procedure

ReDim tableauSix(1 To quantitySix) As Mon_Tableau

ce qui bien entendu ne fonctionne pas !

Merci a lavance !

Fred

6 réponses

Avatar
Eric
Bonjour Fred

Dans un module Basic (.bas) tu mets ta déclaration

'**************************************************************
'Type that will allow me to classified each roll of every kind
'**************************************************************
Type Mon_Tableau
Longueur As Integer 'YD2
noRoll As String 'Roll number
noIndex As Integer 'Key in the database
patron As Integer 'Pattern number
satisfaction As Boolean 'Variable that say if that roll as
been
choosen
End Type

'**********************************************************************
'Variable that is goiing to be my 6 foot and 12 foot array
'**********************************************************************



et dans ce même module tu mets toujours dans les déclarations:
Public tableauSix() As Mon_Tableau ' te permet de les connaitre partout
Public tableauTwelve() As Mon_Tableau ' dans ton appli



Dans le module du formulaire, dans la procédure où tu en as besoin en
premier, tu mets

Redim tableauSix(1 to quantitySix)

Par contre, les 2 instructions suivantes ne sont pas bonnes

Dim tableauSix As String 'All six foot roll information
Dim tableauTwelve As String 'All twelve foot roll information

car je ne crois pas que tu puisses typer tes tableaux dès lors que ce
sont des variables-utilisateur.

Une autre remarque , tu definis noRoll as String mais ca te limite à 1
caractere si noRoll est une chaine. Si c'est le cas et noRoll fait
plusieurs caracteres, défnis le comme String*NombreCaractere

A+
Eric
Avatar
Christian HUBERT-HUGOUD- Xtrem7
Probablement un truc comme cela...

'**********************************************************************
'Variable that is goiing to be my 6 foot and 12 foot array
'***********************************************************************
Dim tableauSix() As String 'All six foot roll information
Dim tableauTwelve() As String 'All twelve foot roll information




"Himselff" a écrit dans le message de
news:FZ8ic.82760$
Cest bien simple comme probleme, jai un type tableau que jai creer, par
contre je ne peux linitialiser tout de suite car il est dinamique donc je


ne
peux que linitialiser apres avoir rouler une certaine procedure , je ne
comprend pas comment je pourrais declarer tout sa pour que mon tableau


soit
accessible de partout dans mon module!

voici mes declarations !

'**************************************************************
'Type that will allow me to classified each roll of every kind
'**************************************************************
Type Mon_Tableau
Longueur As Integer 'YD2
noRoll As String 'Roll number
noIndex As Integer 'Key in the database
patron As Integer 'Pattern number
satisfaction As Boolean 'Variable that say if that roll as been
choosen
End Type

'**********************************************************************
'Variable that is goiing to be my 6 foot and 12 foot array
'***********************************************************************
Dim tableauSix As String 'All six foot roll information
Dim tableauTwelve As String 'All twelve foot roll information

et plus bas dans ma procedure

ReDim tableauSix(1 To quantitySix) As Mon_Tableau

ce qui bien entendu ne fonctionne pas !

Merci a lavance !

Fred




Avatar
Himselff
Jai apporter les modifications que vous mavez proposee et maintenant je
recoi une erreur "Qualificateur Incorecte"

quand jarrive a mettre qque chose dans le tableau

x = 1
tableauSix.patron(x) = "test"

Merci !

"Christian HUBERT-HUGOUD- Xtrem7" wrote in
message news:c6b8r4$jgr$
Probablement un truc comme cela...

> '**********************************************************************
> 'Variable that is goiing to be my 6 foot and 12 foot array
> '***********************************************************************
> Dim tableauSix() As String 'All six foot roll information
> Dim tableauTwelve() As String 'All twelve foot roll information


"Himselff" a écrit dans le message de
news:FZ8ic.82760$
> Cest bien simple comme probleme, jai un type tableau que jai creer, par
> contre je ne peux linitialiser tout de suite car il est dinamique donc


je
ne
> peux que linitialiser apres avoir rouler une certaine procedure , je ne
> comprend pas comment je pourrais declarer tout sa pour que mon tableau
soit
> accessible de partout dans mon module!
>
> voici mes declarations !
>
> '**************************************************************
> 'Type that will allow me to classified each roll of every kind
> '**************************************************************
> Type Mon_Tableau
> Longueur As Integer 'YD2
> noRoll As String 'Roll number
> noIndex As Integer 'Key in the database
> patron As Integer 'Pattern number
> satisfaction As Boolean 'Variable that say if that roll as been
> choosen
> End Type
>
> '**********************************************************************
> 'Variable that is goiing to be my 6 foot and 12 foot array
> '***********************************************************************
> Dim tableauSix As String 'All six foot roll information
> Dim tableauTwelve As String 'All twelve foot roll information
>
> et plus bas dans ma procedure
>
> ReDim tableauSix(1 To quantitySix) As Mon_Tableau
>
> ce qui bien entendu ne fonctionne pas !
>
> Merci a lavance !
>
> Fred
>
>




Avatar
Himselff
hehe jai trouver le probleme !

tableauSix(x).patron = "test"
au lieu de
tableauSix.patron(x) = "test"

"Himselff" wrote in message
news:h4aic.83099$
Jai apporter les modifications que vous mavez proposee et maintenant je
recoi une erreur "Qualificateur Incorecte"

quand jarrive a mettre qque chose dans le tableau

x = 1
tableauSix.patron(x) = "test"

Merci !

"Christian HUBERT-HUGOUD- Xtrem7" wrote in
message news:c6b8r4$jgr$
> Probablement un truc comme cela...
>
> >


'**********************************************************************
> > 'Variable that is goiing to be my 6 foot and 12 foot array
> >


'***********************************************************************
> > Dim tableauSix() As String 'All six foot roll information
> > Dim tableauTwelve() As String 'All twelve foot roll information
>
>
> "Himselff" a écrit dans le message de
> news:FZ8ic.82760$
> > Cest bien simple comme probleme, jai un type tableau que jai creer,


par
> > contre je ne peux linitialiser tout de suite car il est dinamique donc
je
> ne
> > peux que linitialiser apres avoir rouler une certaine procedure , je


ne
> > comprend pas comment je pourrais declarer tout sa pour que mon tableau
> soit
> > accessible de partout dans mon module!
> >
> > voici mes declarations !
> >
> > '**************************************************************
> > 'Type that will allow me to classified each roll of every kind
> > '**************************************************************
> > Type Mon_Tableau
> > Longueur As Integer 'YD2
> > noRoll As String 'Roll number
> > noIndex As Integer 'Key in the database
> > patron As Integer 'Pattern number
> > satisfaction As Boolean 'Variable that say if that roll as


been
> > choosen
> > End Type
> >
> >


'**********************************************************************
> > 'Variable that is goiing to be my 6 foot and 12 foot array
> >


'***********************************************************************
> > Dim tableauSix As String 'All six foot roll information
> > Dim tableauTwelve As String 'All twelve foot roll information
> >
> > et plus bas dans ma procedure
> >
> > ReDim tableauSix(1 To quantitySix) As Mon_Tableau
> >
> > ce qui bien entendu ne fonctionne pas !
> >
> > Merci a lavance !
> >
> > Fred
> >
> >
>
>




Avatar
ng
Salut,

Si j'ai bien compris le problème est de typer le tableau directement. Cela
est difficilement faisable même en passant par du Variant ! Quel est le but
d'une telle manoeuvre ? Pourquoi ne pas déclarer plusieurs tabelaux ?

Car un changement de type n'est pas des plus conseillé !

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/

Himselff a écrit :

Cest bien simple comme probleme, jai un type tableau que jai creer,
par contre je ne peux linitialiser tout de suite car il est dinamique
donc je ne peux que linitialiser apres avoir rouler une certaine
procedure , je ne comprend pas comment je pourrais declarer tout sa
pour que mon tableau soit accessible de partout dans mon module!

voici mes declarations !

'**************************************************************
'Type that will allow me to classified each roll of every kind
'**************************************************************
Type Mon_Tableau
Longueur As Integer 'YD2
noRoll As String 'Roll number
noIndex As Integer 'Key in the database
patron As Integer 'Pattern number
satisfaction As Boolean 'Variable that say if that roll as
been choosen
End Type

'**********************************************************************
'Variable that is goiing to be my 6 foot and 12 foot array
'***********************************************************************
Dim tableauSix As String 'All six foot roll information
Dim tableauTwelve As String 'All twelve foot roll information

et plus bas dans ma procedure

ReDim tableauSix(1 To quantitySix) As Mon_Tableau

ce qui bien entendu ne fonctionne pas !

Merci a lavance !

Fred


Avatar
Himselff
Le but est que jai deux tableau absolument identique a part de leur nom et
des donnnes quil contiennent, mais pour le reste je n'ai plus de probleme
tout semble resolu !

Merci pour le coup de main !

Fred

"ng" wrote in message
news:#
Salut,

Si j'ai bien compris le problème est de typer le tableau directement. Cela
est difficilement faisable même en passant par du Variant ! Quel est le


but
d'une telle manoeuvre ? Pourquoi ne pas déclarer plusieurs tabelaux ?

Car un changement de type n'est pas des plus conseillé !

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/

Himselff a écrit :

> Cest bien simple comme probleme, jai un type tableau que jai creer,
> par contre je ne peux linitialiser tout de suite car il est dinamique
> donc je ne peux que linitialiser apres avoir rouler une certaine
> procedure , je ne comprend pas comment je pourrais declarer tout sa
> pour que mon tableau soit accessible de partout dans mon module!
>
> voici mes declarations !
>
> '**************************************************************
> 'Type that will allow me to classified each roll of every kind
> '**************************************************************
> Type Mon_Tableau
> Longueur As Integer 'YD2
> noRoll As String 'Roll number
> noIndex As Integer 'Key in the database
> patron As Integer 'Pattern number
> satisfaction As Boolean 'Variable that say if that roll as
> been choosen
> End Type
>
> '**********************************************************************
> 'Variable that is goiing to be my 6 foot and 12 foot array
> '***********************************************************************
> Dim tableauSix As String 'All six foot roll information
> Dim tableauTwelve As String 'All twelve foot roll information
>
> et plus bas dans ma procedure
>
> ReDim tableauSix(1 To quantitySix) As Mon_Tableau
>
> ce qui bien entendu ne fonctionne pas !
>
> Merci a lavance !
>
> Fred