Ciao a tutti,
devo usare il Format per scrivere un campo numerico con gli zeri non significativi. Il numero di zeri è però variabile. Ora faccio così:
usocodice:Structure RecordOutput <VbFixedString(50)> Campo1 As String ... <VbFixedString(10)> Progressivo As String End Structure Sub ScriviRecord Dim RO As RecordOutput Dim ContatoreOutput As Long ... RO.Progressivo = Format (ContatoreOutput, Replace(Space(Len(RecordOutput), " ", "0") ) End Sub
Replace(Space(Len(RecordOutput), " ", "0")
solo per scrivere "0000000000".
Esiste una funzione per poter creare una stringa con tanti caratteri quanti ne voglio io (come la "String(Carattere, N)" di VB6)?
![]()

Rispondi quotando