Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Misc > Archive::Off Topic

Archive::Off Topic Archive area for Off Topic's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2004, 12:30 PM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default I hate VB~

I was wondering if one of you was able to point me about a problem i have with VB.
5 years i dont have touch VB, and i admit i have some problems with it lol.

Code:
rivate Sub StartUpdate()
On Error GoTo Failed 'Error Handler
Dim aCnt As Integer 'Loop counter
Dim UpdateString As String 'Holds the update information
Dim aSplit() As String, bSplit() As String 'Used to split the information
Dim UpdateByte() As Byte 'Holds the download
Dim tInt As Integer 'Holds value of split
Dim ff As Integer 'Used for FreeFile
Dim TempData As String 'Holds temporary date to compare

'Get the \update.txt file from the server
UpdateString = iNet.OpenURL(WebAddress, icString)
MsgBox UpdateString

'Strip the NEWS TEXT off the string and display it
tInt = InStr(1, UpdateString, vbCrLf)
MsgBox tInt

'Display the NEWS in the text box
txtMain.Text = Left$(UpdateString, tInt - 1)

'Strip the News Text off the string completely now
UpdateString = Mid$(UpdateString, tInt + Len(vbCrLf))

'Breaks down each update individually
aSplit = Split(UpdateString, vbCrLf)

'Dim the UDT array to hold exact amount of files to update
ReDim uInfo(UBound(aSplit) - 1)

'Create for/next to break up each file update
For aCnt = LBound(aSplit) To UBound(aSplit) - 1
'Breaks down each update individually and writes information
bSplit = Split(aSplit(aCnt), ", ")
    With uInfo(aCnt)
        .fPlacement = Trim$(bSplit(0))
        .fDateFile = Trim$(bSplit(1))
        .fUpdateTime = Trim$(bSplit(2))
        .fGetFile = Trim$(bSplit(3))
    End With
Next aCnt
I know the problem is with "tInt = InStr(1, UpdateString, vbCrLf)", a special TXT File format is needed, but i cant find which one ...
my actual TXT look like this :
Quote:
TEST BLABLABLA.
\eqhost.txt, eqhost.xvx, 24/05/04 5:12:21 AM, http://eqa.eqemulator.net/patcher/eqhost.txt
I bet "vbCrLf" is the problem, but i cant remember how to fix this ... *sight*

Thanks in advance / KhaN
__________________

Reply With Quote
  #2  
Old 05-24-2004, 01:10 PM
mangoo
Items Master
 
Join Date: Apr 2003
Posts: 293
Default Re: I hate VB~

Quote:
Originally Posted by KhaN
I hate VB~
me too

<3 C++
__________________
Reply With Quote
  #3  
Old 05-24-2004, 01:15 PM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default

Quote:
me too

<3 C++
I agree with you, im learning C++ atm in the hope to help EQEmu later and continu to work on EQA, but my VB is still better than my C++, i would let you imagine what my auto patcher would look like in C++ ...

i searched info in web about "vbCrLf", it look it refer to return to line "word wrap" and its not activated when i create the file with notepad or wordpad ... file is loaded and "tInt" return 0 when it should return 1 ... i miss TXT file structure ...
__________________

Reply With Quote
  #4  
Old 05-26-2004, 08:35 PM
Smendle
Fire Beetle
 
Join Date: May 2004
Posts: 3
Default

Quote:
rivate Sub StartUpdate()
On Error GoTo Failed 'Error Handler
Dim aCnt As Integer 'Loop counter
Dim UpdateString As String 'Holds the update information
Dim aSplit() As String, bSplit() As String 'Used to split the information
Dim UpdateByte() As Byte 'Holds the download
Dim tInt As Integer 'Holds value of split
Dim ff As Integer 'Used for FreeFile
Dim TempData As String 'Holds temporary date to compare

'Get the \update.txt file from the server
UpdateString = iNet.OpenURL(WebAddress, icString)
MsgBox UpdateString

'Strip the NEWS TEXT off the string and display it
tInt = InStr(1, UpdateString, vbCrLf)
MsgBox tInt

'Display the NEWS in the text box
txtMain.Text = Left$(UpdateString, tInt - 1)

'Strip the News Text off the string completely now
UpdateString = Mid$(UpdateString, tInt + Len(vbCrLf))

'Breaks down each update individually
aSplit = Split(UpdateString, vbCrLf)
Well first off your taking UpdateString and putting it into an array AFTER you have changed it with Mid and the Mid statement is stripping out the Carriage Return Line Feed

Do asplit after you get updatestring and it should work.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:43 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3