Oppure

Loading
16/11/06 15:18
principiantevb
ciao a tutti,
devo realizzare un programma che salvi il contenuto di alcune text e combo in un file dat con una put..
ma con questo procedimento scrive solo i caratteri "rettangolari" di outlook.. sapete dirmi dove sbaglio?

Private Sub Command1_Click()
Dim scrittura As String
scrittura = Text1 & combo1
MultiLine = True
one = FreeFile
Open App.Path & "\Produzione.dat" For Random As #one Len = 2560
Put #one, 1, scrittura
Close #one
End Sub

inoltre ho notato che dopo la prima registrazione non ne vengono effettuate altre (bene o male con la seconda dovrebbe registrare al record due una sequenza di quadratini..) la Len serve perchè la stringa è lunghissima...

grazie anticipatamente
aaa
16/11/06 16:38
Rand
prova ad aggiungete la proprietà ".text"
...
scrittura = Text1.text & combo1.text
...
aaa
17/11/06 10:37
Reese
Non cambia niente..

Perche' vuoi scrivere quei contenuti usando Put?
aaa
17/11/06 14:01
Apri in binary.



For files opened in Binary mode, all of the Random rules apply, except:

The Len clause in the Open statement has no effect. Put writes all variables to disk contiguously; that is, with no padding between records.


For any array other than an array in a user-defined type, Put writes only the data. No descriptor is written.


Put writes variable-length strings that are not elements of user-defined types without the 2-byte length descriptor. The number of bytes written equals the number of characters in the string.
Ultima modifica effettuata da 17/11/06 14:02