Logo UGIdotNET

Discussione 'Array da Vb a Vb.Net'

# Pubblicato il 22 gen 2004 11.35 - Rispondi
Rino Rino
Array da Vb a Vb.Net
Sto reciclando del codice scritto in Vb in Vb.Net.

La conversione è stata eseguita in automatico dal Framework.....ho cambiato qualcosa e non ci sono errori di compilazione....ma in esecuzione si verifica un errore su un array...almeno credo:

lo dichiara cosi in vb
Dim awTemp()
...
awTemp = Array(600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, _
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600)
For i = .FirstChar To .LastChar
.Widths(i) = awTemp(i - .FirstChar + 1)
Next





mentre dopo il passaggio in vb .net è
Dim awTemp() As Object
...

awTemp = New Object() {600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600}
For i = .FirstChar To .LastChar
'UPGRADE_WARNING: Impossibile risolvere la proprietà predefinita dell'oggetto awTemp(i - arrFONT().FirstChar + 1). Fare clic qui per ulteriori informazioni: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"'
.Widths(i) = awTemp(i - .FirstChar + 1)
Next



Grazie!!!!!!!!!!!!!!!!!!1
# Pubblicato il 22 gen 2004 11.38 - Rispondi
Rino Rino
Re: Array da Vb a Vb.Net
L'errore che si verifica a Run Time:

L'errore che si verifica a Run Time è:

Eccezione non gestita di tipo "System.NullReferenceException" in NomeClasse.exe

Informazioni aggiuntive: Riferimento a un oggetto non impostato su un'istanza di oggetto.


sulla riga:

.Widths(i) = awTemp(i - .FirstChar + 1)
# Pubblicato il 22 gen 2004 11.59 - Rispondi
Cooley
Re: Array da Vb a Vb.Net

scusa ma che modo è di inizializzare un vettore???
non fai prima con un for???
cmq "stile a parte (avrai le tue ragioni)
ma .FirstChar To .LastChar a cosa fanno riferiemnto???
secondo la proprietà Width che tu usi non è predefinita nell'array...
--


Ciao
---------------------------------------------------------------
Cooley (ICQ: 45285257)


"UGI 7012" <UGI7012_TOGLIQUESTASTRINGA@ugidotnet.org> ha scritto nel
messaggio news:10dd20e2-e1e3-4fb9-a914-8cc7255ecb73@UGI31083...
> L'errore che si verifica a Run Time:
>
> L'errore che si verifica a Run Time è:
>
> Eccezione non gestita di tipo "System.NullReferenceException" in
NomeClasse.exe
>
> Informazioni aggiuntive: Riferimento a un oggetto non impostato su
un'istanza
> di oggetto.
>
>
> sulla riga:
>
> Widths(i) = awTemp(i - .FirstChar + 1)
> ----------------------
> Questo messaggio è stato postato da http://www.ugidotnet.org/forum
> UGIdotNET - User Group Italiano .NET


----------------------
Questo messaggio è stato postato da microsoft.public.it.dotnet.vb.
# Pubblicato il 22 gen 2004 12.14 - Rispondi
Rino Rino
Re: Array da Vb a Vb.Net
sono due variabili di tipo Byte
# Pubblicato il 22 gen 2004 12.15 - Rispondi
Cooley
Re: Array da Vb a Vb.Net

tu riporti
For i = .FirstChar To .LastChar
.Widths(i) = awTemp(i - .FirstChar + 1)
Next

ma il "." prima del nome è casuale???
e ".Widths" cosa è???

--


Ciao
---------------------------------------------------------------
Cooley (ICQ: 45285257)

"UGI 7012" <UGI7012_TOGLIQUESTASTRINGA@ugidotnet.org> ha scritto nel
messaggio news:2983c510-f782-4337-b4ae-90b2562e10e1@UGI31086...
> sono due variabili di tipo Byte
> ----------------------
> Questo messaggio è stato postato da http://www.ugidotnet.org/forum
> UGIdotNET - User Group Italiano .NET


----------------------
Questo messaggio è stato postato da microsoft.public.it.dotnet.vb.
# Pubblicato il 22 gen 2004 12.23 - Rispondi
Rino Rino
Re: Array da Vb a Vb.Net
Il file non l'ho scritto io.....ti mando i due allegati.

Uno è il file di vb e l'altro e la classe di vb.net

Ho messo il suffisso txt altrimenti non me li faceva uplodare
# Pubblicato il 22 gen 2004 12.31 - Rispondi
Cooley
Re: Array da Vb a Vb.Net

secondo me l'errore sta nel fatto che arrfont è un vettore ma tu non gli
passi l'indice... e infatti quando converti ti dice...
'UPGRADE_WARNING: Impossibile risolvere la proprietà predefinita
dell'oggetto
awTemp(i - arrFONT().FirstChar + 1). Fare clic qui per ulteriori
informazioni:
vedi questo => arrFONT().FirstChar manca l'indice al vettore arrFont...: )
--


Ciao
---------------------------------------------------------------
Cooley (ICQ: 45285257)

"UGI 7012" <UGI7012_TOGLIQUESTASTRINGA@ugidotnet.org> ha scritto nel
messaggio news:dbcafca6-1279-4659-92b2-68b8228b5194@UGI31088...
> Il file non l'ho scritto io.....ti mando i due allegati.
>
> Uno è il file di vb e l'altro e la classe di vb.net
>
> Ho messo il suffisso txt altrimenti non me li faceva uplodare
>
> attachments:
> http://www.ugidotnet.org/forum/download.asp?
> a=354&contentType=text%2fplain&filename=clsPDFCreator.cls.txt (65651
Bytes)
> http://www.ugidotnet.org/forum/download.asp?
> a=355&contentType=text%2fplain&filename=clsPDFCreator.vb.txt (76694 Bytes)
>
> ----------------------
> Questo messaggio è stato postato da http://www.ugidotnet.org/forum
> UGIdotNET - User Group Italiano .NET


----------------------
Questo messaggio è stato postato da microsoft.public.it.dotnet.vb.
# Pubblicato il 22 gen 2004 12.40 - Rispondi
Rino Rino
Re: Array da Vb a Vb.Net
Ho postato il codice come allegato!!!!!!
# Pubblicato il 22 gen 2004 12.43 - Rispondi
Rino Rino
Re: Array da Vb a Vb.Net
Cmq si riferisce a questo:

With arrFONT(1, pdfFontStyle.pdfBold)
# Pubblicato il 22 gen 2004 13.10 - Rispondi
Rino Rino
Re: Array da Vb a Vb.Net
Non ho capito bene...scusa
# Pubblicato il 22 gen 2004 13.56 - Rispondi
Cooley
Re: Array da Vb a Vb.Net


vedi questo => arrFONT().FirstChar manca l'indice al vettore arrFont...
dovrebbe essere arrFONT( INDICE ).FirstChar
manca l'indice.... :)
--


Ciao
---------------------------------------------------------------
Cooley (ICQ: 45285257)

--

"UGI 7012" <UGI7012_TOGLIQUESTASTRINGA@ugidotnet.org> ha scritto nel
messaggio news:09a5733e-2e77-4a6a-831d-60e58a699a87@UGI31100...
> Non ho capito bene...scusa
> ----------------------
> Questo messaggio è stato postato da http://www.ugidotnet.org/forum
> UGIdotNET - User Group Italiano .NET


----------------------
Questo messaggio è stato postato da microsoft.public.it.dotnet.vb.
# Pubblicato il 22 gen 2004 16.07 - Rispondi
Rino Rino
Re: Array da Vb a Vb.Net
Continuo a non capire molto bene in quanto FirstChar è contenuto nel blocco width.........


per questo non gli manca l'indice.
Può darsi che mi sbaglio.
Grazie ancora!!!!!!!!!!
# Pubblicato il 22 gen 2004 16.33 - Rispondi
Cooley
Re: Array da Vb a Vb.Net

none...
NON è a FirstChar che manca l'indice ma all'array arrFONT di cui First
char è un campo!!! :)
--


Ciao
---------------------------------------------------------------
Cooley (ICQ: 45285257)

"UGI 7012" <UGI7012_TOGLIQUESTASTRINGA@ugidotnet.org> ha scritto nel
messaggio news:436d7e35-f85d-4a9f-b287-441f23ceb7b8@UGI31127...
> Continuo a non capire molto bene in quanto FirstChar è contenuto nel
blocco
> width.........
>
>
> per questo non gli manca l'indice.
> Può darsi che mi sbaglio.
> Grazie ancora!!!!!!!!!!
> ----------------------
> Questo messaggio è stato postato da http://www.ugidotnet.org/forum
> UGIdotNET - User Group Italiano .NET


----------------------
Questo messaggio è stato postato da microsoft.public.it.dotnet.vb.

© 2001 User Group Italiano UGIdotNET. Tutti i diritti riservati. Note legali. - Partita IVA 01927050185