ThePentiumGuy
Senior Contributor
There's a VB tag problem on this forum which is not present on the XVBT forum. If you want some examples I can show you plenty . One reason being that if there is one comment in the source code, it thinks the rest is a comment.
The VB code tags are MUCH cleaner on the other forum:
http://www.xtremevbtalk.com/showpost.php?p=922655&postcount=1
I realize that you don't have access to the source code from iNET. However, I thought the 2 forums were based off the same source code. So why is this even a problem? And I know it's not your fault .
-The Pentium Guy
Visual Basic:
line = reader.readline
If Not line.contains(":") Then
'Read it like normal
'This is easy
Else
s =line.split(":")
if s(0) = "Choice" then LookAtChoice(line) End If
End If
Public Sub LookAtChoice(line as string)
Dim colonSplit() as string
Dim commaSplit() as String
Dim numberofchoices as integer
colonsplit = line.Split(":") 'Split "Choice:Yes,No:Would you like some money?"
texttodisplay = colonsplit(2) ' "Would you like some money"
commasplit = colonsplit(1).Split(",")
numberofchoices = commasplit(0)
' I'll create a DisplayChoiceList function somewhere else.
' The game will only be able to hold 2, 3, or 4 choices
if numberofchoices = 2 then DisplayChoiceList(numchoices, commasplit(1), commasplit(2))
if numberofchoices = 3 then DisplayChoiceList(numchoices, commasplit(1), commasplit(2), commasplit(3))
if numberofchoices = 4 then DisplayChoiceList(numchoices, commasplit(1), commasplit(2), commasplit(3), commasplit(4))
UpdateTextToDisplay()
End Sub
'Later, when the player chooses a choice:
Public sub CheckForChoices(myChoice as String)
Reader.readline() 'The #Choice line is just for cleansiness
Dim numLines as string
loop until reader.readline = myChoice & ":" 'The line looks like " Yes: "
numlines = cint(reader.readline) ' the 2 in the line after Yes: .. or No:
for x as integer = 1 to numlines
texttodisplay = reader.read
UpdateTextToDisplay()
next
Loop until reader.readline = "#EndChoice"
'Skip the rest of the choices
Wend
Wend
End Sub
The VB code tags are MUCH cleaner on the other forum:
http://www.xtremevbtalk.com/showpost.php?p=922655&postcount=1
I realize that you don't have access to the source code from iNET. However, I thought the 2 forums were based off the same source code. So why is this even a problem? And I know it's not your fault .
-The Pentium Guy