Click here to Skip to main content
       

Visual Basic

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: VB6 Won't Install On Windows 7 Pro x64memberCodeZombie621 Jul '12 - 13:56 
GeneralRe: VB6 Won't Install On Windows 7 Pro x64mvpDave Kreskowiak1 Jul '12 - 14:38 
GeneralRe: VB6 Won't Install On Windows 7 Pro x64memberCodeZombie621 Jul '12 - 15:08 
AnswerRe: VB6 Won't Install On Windows 7 Pro x64memberMike Deeks2 Jul '12 - 0:17 
QuestionGeo fix latitude longitude with VB6? for Googlemapsmemberkhardani30 Jun '12 - 14:11 
AnswerRe: Geo fix latitude longitude with VB6? for GooglemapsmvpRichard MacCutchan30 Jun '12 - 21:30 
Generalchar detection, for char replacement or formattingmemberjkirkerx30 Jun '12 - 8:27 
I'm messing around (experimenting) with some Flash Action Script Text file.
 
I want to read the file, and display it in html for a preview, sort of like a thumbnail view.
 
I tried File.ReadAllLines, but it stripped out all the tabs and linefeeds.
 
So I tried reading the stream, converting from bytes to chars. So now I have a string array of text lines in char form,
 
[Question]
I can detect &H9 for the tab in byte, but I'm not sure how to detect the char version of &H9 which shows up as ""c
 
[EDIT][Objective]
I want to do some formatting, in which I replace the tab with   or something, and perhaps do some color coding for comments in green, and so forth for use on a web page.
 
Perhaps I should leave the text the way it is, and just use a richText object, which might accept the strings in the current form.
 
Dim asStream As FileStream = New FileStream(physicalPath, FileMode.Open, FileAccess.Read)
            Dim asLen As Long = asStream.Length
            Dim fileData As Byte() = New Byte(asLen) {}
            asStream.Read(fileData, 0, asLen)
            asStream.Close()
 
            Dim byteLine() As Byte = New Byte() {}
            Dim strArray() As String = New String() {}
            For bdx As Integer = 0 To fileData.Length - 1
 
                Dim byteVal As Byte = fileData(bdx)
                If Not (byteVal = &HD) Then
 
                    Array.Resize(byteLine, byteLine.Length + 1)
                    byteLine(byteLine.Length - 1) = byteVal
 
                Else
                    Array.Resize(byteLine, byteLine.Length + 1)
                    byteLine(byteLine.Length - 1) = byteVal
 
                    Dim charLine() As Char = New Char() {}
                    Array.Resize(charLine, byteLine.Length + 1)
 
                    For cdx As Integer = 0 To byteLine.Length - 1
 
                        charLine(cdx) = AsciiByteToChar(byteLine(cdx))
 
                    Next
 
                    Dim value As String = New String(charLine)
                    Array.Resize(strArray, strArray.Length + 1)
                    strArray(strArray.Length - 1) = value
 
                    Array.Resize(byteLine, 0)
                    bdx += 1
 
                End If
            Next

GeneralRe: char detection, for char replacement or formattingmvpLuc Pattyn30 Jun '12 - 9:12 
GeneralRe: char detection, for char replacement or formattingmemberjkirkerx30 Jun '12 - 19:09 
GeneralRe: char detection, for char replacement or formattingmemberjkirkerx2 Jul '12 - 11:28 
QuestionSending URL to an external web browsermemberTim Reece29 Jun '12 - 16:20 
AnswerRe: Sending URL to an external web browsermvpRichard MacCutchan29 Jun '12 - 21:19 
QuestionDLL QuestionmemberNo-e29 Jun '12 - 5:26 
GeneralRe: DLL QuestionmvpDave Kreskowiak29 Jun '12 - 6:48 
AnswerRe: DLL QuestionmvpLuc Pattyn29 Jun '12 - 7:12 
Questiontrojans?memberNo-e28 Jun '12 - 8:40 
AnswerRe: trojans?memberWes Aday28 Jun '12 - 10:35 
GeneralRe: trojans?mvpAbhinav S28 Jun '12 - 17:36 
AnswerRe: trojans?memberBernhard Hiller28 Jun '12 - 21:16 
GeneralRe: trojans?memberNo-e29 Jun '12 - 5:19 
QuestionEvent on Scrolling to the end in flowlayoutpanelmemberAmmar_Ahmad28 Jun '12 - 7:14 
AnswerRe: Event on Scrolling to the end in flowlayoutpanelmemberNick Otten29 Jun '12 - 1:06 
GeneralRe: Event on Scrolling to the end in flowlayoutpanelmemberAmmar_Ahmad29 Jun '12 - 1:44 
GeneralRe: Event on Scrolling to the end in flowlayoutpanelmemberNick Otten29 Jun '12 - 1:54 
GeneralRe: Event on Scrolling to the end in flowlayoutpanelmemberAmmar_Ahmad29 Jun '12 - 2:03 

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


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 17 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid