[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
Go Back  Xtreme Visual Basic Talk > > > [VB6 and API] - learning mutliplayer games


Reply
 
Thread Tools Display Modes
  #41  
Old 11-03-2010, 08:01 PM
elemein elemein is offline
Newcomer
 
Join Date: Oct 2010
Posts: 14
Default


This is confusing to me, what is left$ and right? @_@
Reply With Quote
  #42  
Old 11-03-2010, 09:53 PM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default Functions

They are functions used in Visual Basic 6 to return a string, but only partial.

So Left$("string", 3) = "str" only 3 characters from the left

Right$("string", 3) = "ing" only 3 characters from the right

Here's what the data looks like from this part:

Code:
If InStr(1, sstrBufferedData, "|", vbTextCompare) > 0 Then 'Split The Data And Find Which Code To Run astrSplitData = Split(sstrBufferedData, "|", -1, vbTextCompare) 'First Element Not Used, astrSplitData(0) For intNextNumber = (LBound(astrSplitData) + 1) To UBound(astrSplitData) 'Announce strDataWithoutDelimiter = Right$(astrSplitData(intNextNumber), _ Len(astrSplitData(intNextNumber)) - 4) 'Check Which Data Is Received Select Case Left$(astrSplitData(intNextNumber), 3)

Data is like this "|00X XXXXXX|00X XXXXXXX" and so on... to get this working, we check for "|" first, if there continue. Using InStr().

Then we split the data by "|" into an array so that we have different elements.

Array(0) = ""
Array(1) = "00X XXXXXXX"
Array(2) = "00X XXXXXX"

Now we loop through the array, find what type of case we need to do. Maybe we got a message, or someone do something else. We use the bounds of the array, but not 0, therefore LBound + 1 which will start at 1. Then we continue this cycle until all the array elements have been cycled through. For i = LBound(array + 1) To UBound(array), Next statement.

So the first cycle we have array(1), but we need to know what case should be triggered by this point. So we only need the string from the left by 3, "00X XXXXXX" We get "00X" Which could be "002" Message Received!

But now we need to update the lobby because of this. But we need to know what the message said. So we get the right$() of it. We will get everything except the "00X " which is 4 characters. Therefore Right$("string", Len("string") - 4), get from the right everything of "string" except 4 characters. And now we have the message and we can display it in the lobby.

Is this a little more helpful? If this is still a little confusing by this point it is because this code written is not for beginners, and again you will have to study it to move on from here. Make sure you follow the link in your inbox.
__________________
ZaCkO ... Who is your attitude?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games [VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
 
[VB6 and API] - learning mutliplayer games
[VB6 and API] - learning mutliplayer games
 
-->