Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Visual Basic 6 - problema put
Forum - Visual Basic 6 - problema put

Avatar
principiantevb (Normal User)
Newbie


Messaggi: 11
Iscritto: 08/08/2006

Segnala al moderatore
Postato alle 16:18
Giovedì, 16/11/2006
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

PM Quote
Avatar
Rand (Ex-Member)
Pro


Messaggi: 163
Iscritto: 17/05/2005

Segnala al moderatore
Postato alle 17:38
Giovedì, 16/11/2006
prova ad aggiungete la proprietà ".text"
Codice sorgente - presumibilmente Plain Text

  1. ...
  2. scrittura = Text1.text & combo1.text
  3. ...


PM Quote
Avatar
Reese (Ex-Member)
Pro


Messaggi: 179
Iscritto: 09/08/2006

Segnala al moderatore
Postato alle 11:37
Venerdì, 17/11/2006
Non cambia niente..

Perche' vuoi scrivere quei contenuti usando Put?

PM Quote
Avatar
()
Newbie


Messaggi:
Iscritto:

Segnala al moderatore
Postato alle 15:01
Venerdì, 17/11/2006
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 il 17/11/2006 alle 15:02
PM Quote