I didn't see your request for multilanguage support and I don't know much about it but check out this site at VBHelper http://www.vb-helper.com/tut11.htm.
Wayne
Michael <[EMAIL PROTECTED]> wrote:
Michael <[EMAIL PROTECTED]> wrote:
Thank you very much for the great help! I have updatedI
my code with your routine and it works (much better).
Please if you have any ideea answer to my email about
Multilanguage Support in VB. If you did not receive
it, tell me to post it again.
--- Boyd Spangler <[EMAIL PROTECTED]> wrote:
>
> A more effecient way to do this is:
>
> Private Sub cmdParse_Click()
>
> Dim Pos As Integer
>
> Dim nrLines as Integer (or Long)
>
> sLines=Split(txtMain.Text, vbCrLf)
>
> Open App.Path & "\" & "output.txt" For Append As #1
>
> for nrLines = 0 to UBound(sLines)
>
> Pos=InStrRev(sLines(nrLines),"\")
>
> Result=Mid$(sLines(nrLines),Pos+1)
>
> Print #1,Result
>
> next
>
> Close #1
> ;
> End Sub
>
> Always define your variables. A variant is the
> slowest and largest of the variables.
>
> Split shouldn't be used over and over 3000 times it
> too is slow. It is used right in the splitting of
> the main text anything else would be a waste of
> time.
>
> Also opening and closing a file 3000 times slows
> down the program. Open it, write information to it
> and then close it.
>
> Don't take anyting I say as insulting....it is not
> meant that way.
>
> Wayne
>
>
> anlaahoy <[EMAIL PROTECTED]> wrote:
>
> That's alright!
> I thought you were going to read the lines from a
> file...lol
>
> regards
>
> anla
> --- In [EMAIL PROTECTED], B Mihai
> <[EMAIL PROTECTED]>
> wrote:
> > Thank you all for your help.
> >
> > This is my solution resulting from your tips and
> > coding snippets.
> >
> > ===========
> > Private Sub cmdParse_Click()
> > Dim Temp, nrLines, LineNumber
> >
> > sLines = Split(txtMain.Text, vbCrLf)
> >
> > For nrLines = 0 To UBound(sLines)
> > LineNumber = sLines(nrLines)
> > ScanLine (LineNumber)
> > Next
> >
> > End Sub
> >
> > Function ScanLine(xLine)
> > Dim xTemp, Parsed, UParse, Result
> > xTemp = Split(xLine, "\")
> > UParse = UBound(xTemp)
> > Result = xTemp(UParse)
> > Open App.Path & "\" & "output.txt" For Append As
> #1
> > Print #1, Result
> > Close #1
> > End Function
> > ==============
> >
> > Very effective for what I needed.
> >
> > Happy coding and thank you all very much once
> again
> > for the ideeas!
> > --- anlaahoy <[EMAIL PROTECTED]> wrote:
> >
> > >
> > >
> > >
> > > Dim sFileName As String
> > > Dim lFile As Long
> > > Dim sLine As String
> > > Dim lCount As Long
> > > Dim Temp
> > > Dim Parsed
> > >
> > >
> > >
> > > ' Change the filename below to your
> filename:
> > > sFileName = "C:\test.txt"
> > >
> > > ' Get a safe file handle.
> > > lFile = FreeFile
> > > & nbsp; ' Initialize the menu index counter.
> > > lCount = 0
> > >
> > > ' Open the input file.
> > > Open sFileName For Input As #lFile
> > >
> > > ' Read every line in the file.
> > >
> > > Do While Not EOF(lFile)
> > > lCount = lCount + 1
> > > Line Input #lFile, sLine
> > > If Not Len(sLine) = 0 Then
> > > Temp = Split(sLine, "\")
> > > For Parsed = 0 To UBound(Temp)
> > > MsgBox Temp(Parsed), vbInformation,
> > > "Split Sample"
> > > Next
> > >
> > > End If
> > > Loop
> > > MsgBox "Total number of lines:" & lCount
> > > Close #lFile
> > >
> > >
> > > --- In [EMAIL PROTECTED], B Mihai
> > > <[EMAIL PROTECTED]>
> > > wrote:
> > > >
> > > > Here is what I coded in combination with what
> you
> > > > helped.
> > > >
> > > > Dim Temp
> > > > Dim nrLines
> > > > Dim Parsed
> > > >
> > > > sLines = Split(txtMain.T ext, vbCrLf)
> > > >
> > > > For nrLines = 0 To UBound(sLines)
> > > > Temp = Split(nrLines, "\")
> > > > For Parsed = 0 To UBound(Temp)
> > > > MsgBox Temp(Parsed), vbInformation, "Split
> Sample"
> > > > Next
> > > > Next
> > > >
> > > >
> > > > This is not yet the solution, as it returns
> the
> > > number
> > > > of the line where the procedure is, and not
> the
> > > last
> > > > part of each line (i.e. the text after "\" of
> each
> > > > line )
> > > >
> > > > The problem is : I dont know how to read a
> line of
> > > > text from a file, at a time. Note that
> > > txtMain.text
> > > > has a file loaded into it and "slines" is
> declared
> > ; > in
> > > > order to be used to split the file into lines.
> Now
> > > > after the spliting into lines is done, how to
> I
> > > read
> > > > one line at a time in order to process it ?
> > > >
> > > > Thank you! Waiting for answer.
> > > > --- anla ahoy <[EMAIL PROTECTED]> wrote:
> > > >
> > > > >
> > > > > Dim Temp
> > > > > Dim Parsed
> > > > > Temp =
> Split("a\sdf\ghj\file=389593452342","\")
> > > > >
> > > > > For Parsed = 0 To UBound(Temp)
> > > > > MsgBox "Temp(" & Parsed & ") = " &
> Temp
> > > > > (Parsed), vbInformation, "Split Sample"
> > > > > Next
> > > > >
> > > > > --- B Mihai <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > >
>
=== message truncated ===
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
To unsubscribe, send an email to:
[EMAIL PROTECTED]
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!
To unsubscribe, send an email to:
[EMAIL PROTECTED]
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/PlanetSourceCode/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
