Click here to Skip to main content
16,005,467 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Question about CSV file Pin
Dave Sexton11-Oct-06 21:01
Dave Sexton11-Oct-06 21:01 
GeneralRe: Question about CSV file Pin
TeiUKei11-Oct-06 21:51
TeiUKei11-Oct-06 21:51 
GeneralRe: Question about CSV file Pin
Dave Kreskowiak12-Oct-06 3:07
mveDave Kreskowiak12-Oct-06 3:07 
GeneralRe: Question about CSV file Pin
TeiUKei12-Oct-06 14:17
TeiUKei12-Oct-06 14:17 
GeneralRe: Question about CSV file Pin
Dave Kreskowiak12-Oct-06 16:04
mveDave Kreskowiak12-Oct-06 16:04 
GeneralRe: Question about CSV file Pin
TeiUKei12-Oct-06 16:35
TeiUKei12-Oct-06 16:35 
GeneralRe: Question about CSV file Pin
Dave Kreskowiak13-Oct-06 1:54
mveDave Kreskowiak13-Oct-06 1:54 
GeneralRe: Question about CSV file Pin
TeiUKei14-Oct-06 14:47
TeiUKei14-Oct-06 14:47 
Really? So, how about when it convert to text file?

Anyway,this is where aaa defined which you ask about.

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Data1 As New PropertyCreateFile
Dim aa As New ArrayList
aa.Add("A45855")
aa.Add("b")
aa.Add("120306")
aa.Add("c234")
aa.Add("M45686")
Data1.Data = aa
Data1.Counter = 3

aaa.CreateCSVFile(Data1)

End Sub

'This is the code for PropertyCreateFile. It will take in the data detail and 'counter on how many times it will loop.

Public Class PropertyCreateFile

Dim Str As ArrayList
Dim Ctr As Integer
Dim UBSBadgeNo As Integer

Public Property Data() As ArrayList
Get
Return Str
End Get
Set(ByVal Value As ArrayList)
Str = Value
End Set
End Property

Public Property Counter() As Integer
Get
Return Ctr
End Get
Set(ByVal Value As Integer)
Ctr = Value
End Set
End Property

End Class

Public Function CreateCSVFile(ByVal CreatePP As PropertyCreateFile) As String

Dim sFilename As String = (CurDir & "/CSVFile.csv")
Dim b As Integer
Dim a As Integer
Dim c As String
Dim x As String
Dim Data(4) As String

FileOpen(20, sFilename, OpenMode.Output)

For b = 0 To CreatePP.Counter - 1

For a = 0 To 4
c = CStr(CreatePP.Data(a))

If c.Length <= 1 Then
c = c.PadRight(2, CChar(" "))
ElseIf c.Length <= 2 Then
c = c.PadRight(3, CChar(" "))
ElseIf c.Length > 2 And c.Length <= 4 Then
c = c.PadRight(5, CChar(" "))
ElseIf c.Length > 4 And c.Length <= 6 Then
c = c.PadRight(7, CChar(" "))
ElseIf c.Length > 6 And c.Length <= 11 Then
c = c.PadRight(12, CChar(" "))

End If

Data(a) = c

Next a


x = Data(0) + Data(1) + Data(2) + Data(3) + Data(4)
WriteLine(20, x, Environment.NewLine)

Next b

FileClose(20)

Return Nothing



End Function

Thanks for help, Dave!!
GeneralRe: Question about CSV file Pin
Dave Kreskowiak15-Oct-06 3:39
mveDave Kreskowiak15-Oct-06 3:39 
Questioncystal reports deployment using typed datasets Pin
steve_rm11-Oct-06 18:04
steve_rm11-Oct-06 18:04 
AnswerRe: error on store procedure link to vb Pin
Dave Kreskowiak12-Oct-06 3:06
mveDave Kreskowiak12-Oct-06 3:06 
QuestionWhich is better? Pin
UltraCoder11-Oct-06 14:06
UltraCoder11-Oct-06 14:06 
AnswerRe: Which is better? Pin
Ray Cassick11-Oct-06 18:22
Ray Cassick11-Oct-06 18:22 
GeneralRe: Which is better? Pin
UltraCoder11-Oct-06 18:51
UltraCoder11-Oct-06 18:51 
QuestionChanging The Screensaver Through The Registry Pin
UltraCoder11-Oct-06 14:01
UltraCoder11-Oct-06 14:01 
AnswerRe: Changing The Screensaver Through The Registry Pin
Dave Kreskowiak12-Oct-06 1:50
mveDave Kreskowiak12-Oct-06 1:50 
GeneralRe: Changing The Screensaver Through The Registry Pin
UltraCoder12-Oct-06 7:51
UltraCoder12-Oct-06 7:51 
QuestionData adapter configuration wizard problem Pin
penguin500011-Oct-06 11:28
penguin500011-Oct-06 11:28 
AnswerRe: Data adapter configuration wizard problem Pin
Dave Sexton11-Oct-06 20:54
Dave Sexton11-Oct-06 20:54 
GeneralRe: Data adapter configuration wizard problem Pin
penguin500012-Oct-06 9:44
penguin500012-Oct-06 9:44 
QuestionFile Indexing Pin
UltraCoder11-Oct-06 11:19
UltraCoder11-Oct-06 11:19 
AnswerRe: File Indexing Pin
Dave Kreskowiak11-Oct-06 11:43
mveDave Kreskowiak11-Oct-06 11:43 
GeneralRe: File Indexing Pin
UltraCoder11-Oct-06 12:20
UltraCoder11-Oct-06 12:20 
GeneralRe: File Indexing Pin
Dave Kreskowiak11-Oct-06 13:26
mveDave Kreskowiak11-Oct-06 13:26 
GeneralRe: File Indexing Pin
UltraCoder11-Oct-06 13:33
UltraCoder11-Oct-06 13:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.