Hitmanpt Posted July 3, 2012 at 12:20 PM Report #466991 Posted July 3, 2012 at 12:20 PM (edited) Boas pessoal... Eu estou com um problema num array tenho por exemplo teste codigo Public Class codCFGedit Dim lines() As String Private Sub btnREAd_Click(sender As System.Object, e As System.EventArgs) Handles btnREAd.Click lstcommands.Items.Clear() lines = Nothing lines = IO.File.ReadAllLines(txtCFGloc.Text) exID = 0 For Each line As String In lines If line.Contains("// generated") Then exID = exID + 1 Else lstcommands.Items.Add(line.Split("""")(0).Trim()) End If Next End Sub E até ai tudo bem Agora quero adicionar uma nova linha ou seja adicionar mais um valor ao array... mas nao estou a conseguir... alguma ideia? Edited July 3, 2012 at 01:00 PM by Caça
Caça Posted July 3, 2012 at 01:00 PM Report #466996 Posted July 3, 2012 at 01:00 PM Tens de o redimensionar, utilizar o ReDim ou ReDim Preserve. Pedro Martins Não respondo a duvidas por PM
thoga31 Posted July 3, 2012 at 01:04 PM Report #466998 Posted July 3, 2012 at 01:04 PM Além do ReDim, salvo erro o método Resize da classe Array fará o mesmo 😉 Knowledge is free!
Hitmanpt Posted July 3, 2012 at 01:39 PM Author Report #467005 Posted July 3, 2012 at 01:39 PM Ha... Muito obrigado problema resolvido 😉
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now