|
| HOMEPAGE | INDICE FORUM | REGOLAMENTO | ::. | NEI PREFERITI | .:: | RSS Forum | RSS News | NEWS web | NEWS software | |
| PUBBLICITA' | | | ARTICOLI | WIN XP | VISTA | WIN 7 | REGISTRI | SOFTWARE | MANUALI | RECENSIONI | LINUX | HUMOR | HARDWARE | DOWNLOAD | | | CERCA nel FORUM » | |
19-05-2003, 11.15.13 | #1 |
Junior Member
Registrato: 20-09-2002
Messaggi: 54
|
VB6 - Passaggio matrice ad una funzione
qualcuno può aiutarmi?? Dim Vet(4,50) as string Private Sub Form_Load() 'faccio delle operazioni di riempimento della matrice 'Richiamo la funzione Elabora_Matrice (Vet) End Sub private function Elabora_Matrice(come passo qui la matrice????) End Function |
19-05-2003, 12.05.56 | #2 |
Gold Member
WT Expert
Registrato: 09-01-2002
Loc.: None of your business
Messaggi: 5.505
|
Le matrici per essere passate come parametro ad una funzione devono essere di tipo variant e passate esclusivamente by reference.
Ciao |
19-05-2003, 12.06.54 | #3 |
Gold Member
WT Expert
Registrato: 09-01-2002
Loc.: None of your business
Messaggi: 5.505
|
Codice:
private function Elabora_Matrice(Vet()) End Function |
19-05-2003, 12.20.09 | #4 |
Gold Member
WT Expert
Registrato: 09-01-2002
Loc.: None of your business
Messaggi: 5.505
|
Questo piccolo codice ti sarà sicuramente di aiuto
Codice:
Dim vet(1 To 2, 1 To 2) As Variant Private Sub Form_Load() 'faccio delle operazioni di riempimento della matrice vet(1, 1) = "Lory" vet(1, 2) = "yroL" vet(2, 1) = "One" vet(2, 2) = "enO" 'Richiamo la funzione Elabora_Matrice vet() End Sub Private Sub Elabora_Matrice(vet()) Dim Ty As Long, yt As Long Dim a As Long, b As Long, c As Long, d As Long a = LBound(vet(), 1) b = LBound(vet(), 2) c = UBound(vet(), 1) d = UBound(vet(), 2) For Ty = a To c For yt = b To d Debug.Print vet(Ty, yt) Next Next End Sub Ciao |
19-05-2003, 12.50.21 | #5 |
Gold Member
WT Expert
Registrato: 09-01-2002
Loc.: None of your business
Messaggi: 5.505
|
...quando la pazzia supera i limiti:
Codice:
Private Sub DimensioniMatrice(vet()) Dim S As String Dim Id As Long, Ty As Long On Local Error GoTo Errore Id = 4 Ty = LBound(vet(), Id) S = "La matrice è " S = S & Choose(Id, "monodimensionale", "bidmensionale", "tridimensionale", "quadridimensionale") MsgBox S Exit Sub Errore: Id = Id - 1 Resume End Sub |
Utenti attualmente attivi che stanno leggendo questa discussione: 1 (0 utenti e 1 ospiti) | |
Strumenti discussione | |
|
|
Discussioni simili | ||||
Discussione | Autore discussione | Forum | Risposte | Ultimo messaggio |
funzione void con una matrice come parametro | luca881222 | Programmazione | 1 | 04-12-2007 23.11.59 |
RISOLTO [php + Javascritp] passaggio variabile | Gergio | Programmazione | 2 | 31-05-2005 21.34.25 |
puntatore a matrice | otto_cb | Programmazione | 4 | 09-08-2004 22.47.56 |
AIUTO funzione di Cerca.. o SEARCH bloccata | atir1974 | Windows 9x/Me/NT4/2000 | 0 | 06-10-2003 17.40.29 |
Passaggio difficoltoso Alice 20 ore > Alice Flat | marzina | Internet e Reti locali | 6 | 23-09-2003 01.03.27 |