12 Replies - 3885 Views - Last Post: 21 October 2011 - 08:39 PM Rate Topic: -----

#1 mapmd1234  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 140
  • Joined: 04-December 09

overflow errors in the vb rpg again

Posted 13 October 2011 - 02:41 PM

just got back to having even a tiny amount of time to work on the rpg again, due to working 2 jobs and going to college now, I have very little time for anything...

and I cant for the life of me remember what I did to fix this issue, but I had unfortunately lost my fixed version of the rpg due to the raid array that it was stored on failing... I have tried everything that I can think of, including killing the save file prior to saving it and logging out of the game... that worked if you straight up logged out and quit the game, but if you just log out and log back in, as I do to test that it works, then the data duplicates over and over until the overflow happens... I even checked my fileops.clear function that I modified to fix this, or so I thought... it clears the stats.ci stats, but apparently to no avail... so any and all help regarding this issue is very much appriciated, but I will not be able to reply quickly at all...

here is some of the code that might play a part in the issue...

fileops module

Option Explicit
Dim temp As String
Dim name As String
Dim pass As String
Dim letter As String
Dim x, c As Integer
Dim intf As Integer
Dim stat(1 To 20) As Integer
Dim Sstat(1 To 20) As String
Public Sub save(path As String)

path = App.path & "\" & Stats.CI.charactername & " the " & Stats.CI.speciesname & ".txt"



intf = FreeFile
Open path For Output As #intf
    Write #intf, Stats.CI.charactername
    Write #intf, Stats.CI.password
    'Write #intf, Stats.CI.species
    Write #intf, Stats.CI.agility
    Write #intf, Stats.CI.dexterity
    Write #intf, Stats.CI.endurance
    Write #intf, Stats.CI.health
    Write #intf, Stats.CI.intelect
    Write #intf, Stats.CI.parry
    Write #intf, Stats.CI.speed
    Write #intf, Stats.CI.strength
    Write #intf, Stats.CI.totalexp
    Write #intf, Stats.CI.health
    Write #intf, Stats.CI.exphave
    Write #intf, Stats.CI.expleftover
    Write #intf, Stats.CI.expneed
    Write #intf, Stats.CI.level
    Write #intf, Stats.CI.maxdamage
    Write #intf, Stats.CI.MaxHealth
    Write #intf, Stats.CI.mindamage
    Write #intf, Stats.CI.skillpoints
    Write #intf, Stats.CI.turnspeed
Close #intf

'shroud.encrypt (path)
End Sub
Public Sub load(path As String)


path = (App.path & "\" & Stats.CI.charactername & " the " & Stats.CI.speciesname & ".txt")
intf = FreeFile
x = 0
'shroud.decrypt (path)
Open path For Input As #intf
    Input #intf, name
    Input #intf, pass
    Do Until EOF(intf)
        Input #intf, temp
        If temp = name Or temp = pass Then
            temp = ""
        Else
        x = x + 1
            For c = 1 To Len(temp)
                letter = Mid(temp, c, 1)
                If letter = "1" Or letter = "2" Or letter = "3" Or letter = "4" Or letter = "5" Or letter = "6" Or letter = "7" Or letter = "8" Or letter = "9" Then
                    Sstat(x) = Sstat(x) + letter
                End If
            Next c
        End If
    Loop
For x = 1 To 20
    If stat(20) Then
        stat(20) = 0
        Sstat(20) = ""
        x = 0
        Close #intf
    Else
        stat(x) = Val(Sstat(x))
    End If
Next x
Stats.CI.charactername = name
Stats.CI.password = pass
Stats.CI.agility = stat(1)
Stats.CI.dexterity = stat(2)
Stats.CI.endurance = stat(3)
Stats.CI.health = stat(4)
Stats.CI.intelect = stat(5)
Stats.CI.parry = stat(6)
Stats.CI.speed = stat(7)
Stats.CI.strength = stat(8)
Stats.CI.totalexp = stat(9)
Stats.CI.health = stat(10)
Stats.CI.exphave = stat(11)
Stats.CI.expleftover = stat(12)
Stats.CI.expneed = stat(13)
Stats.CI.level = stat(14)
Stats.CI.maxdamage = stat(15)
Stats.CI.MaxHealth = stat(16)
Stats.CI.mindamage = stat(17)
Stats.CI.skillpoints = stat(18)
Stats.CI.turnspeed = stat(19)
Close #intf

'shroud.encrypt (path)
End Sub
Public Sub log(path As String, namec As String)
intf = FreeFile
If Dir$(path) = "" Then
    Open App.path For Output As #intf
        Write #intf, namec
    Close #intf
Else
    Open path For Input As #1
    Open Left(App.path, 2) + "\temp.txt" For Output As #2
        Do Until EOF(1)
            Input #1, name
            Write #2, name
        Loop
            Write #2, namec
    Close #2
    Close #1
    Kill (path)
    Open path For Output As #1
    Open Left(App.path, 2) + "\temp.txt" For Input As #2
        Do Until EOF(2)
            Input #2, name
            Write #1, name
        Loop
    Close #2
    Close #1
    Kill (Left(App.path, 2) + "\temp.txt")
End If
End Sub
Public Sub load_log(path As String, box As ComboBox)
intf = FreeFile
box.clear
Open path For Input As #intf
    Do Until EOF(intf)
        Input #intf, temp
        box.AddItem (temp)
    Loop
Close #intf
End Sub
Public Sub clear()
Stats.CI.charactername = ""
Stats.CI.password = ""
Stats.CI.expneed = 0
Stats.CI.skillpoints = 0
Stats.CI.exphave = 0
Stats.CI.totalexp = 0
Stats.CI.expleftover = 0
Stats.CI.strength = 0
Stats.CI.endurance = 0
Stats.CI.intelect = 0
Stats.CI.dexterity = 0
Stats.CI.agility = 0
Stats.CI.mindamage = 0
Stats.CI.maxdamage = 0
Stats.CI.MaxHealth = 0
Stats.CI.speed = 0
Stats.CI.health = 0
Stats.CI.level = 0
Stats.CI.parry = 0
Stats.CI.turnspeed = 0
Game_window.Hide
play_b4.Show
End Sub




stats module

Option Explicit
Public Type charinfo
login As Boolean
speciesname As String
'public for the form typ containing the user info(password and username)'
spendstrength As Integer 'the amount of skill points that the player has currently spent on strength, a temporary stat
charactername As String
password As String
pass As String
species As Integer 'the characters class, and this determins the characters baseline stat settup
expneed As Integer 'the amount of exp that the character needs to level
skillpoints As Integer 'again, self explanitory, this holds the characters max spendable skill points
exphave As Integer 'this is a self explanitory stat the holds the characters current exp points
totalexp As Integer 'why do we have this. it is redundant
expleftover As Integer 'could be left in xphave
strength As Integer 'this stat determins the characters max damage that can possibly be inflicted to the opponent
endurance As Integer 'this determins the characters max health
intelect As Integer 'this is the stat that determins what spells and what level of power of spells the character can use
dexterity As Integer 'its dextarity not dextersity should deal with what wepons you can weald or undoing traps
agility As Integer 'is the stat that dictates how easily the character can avoid the opponents attacks
mindamage As Integer 'should always be calculated based on strength
maxdamage As Integer 'should be calculated based on stats not be set.
MaxHealth As Integer 'should always be calculated based on endurance
speed As Integer
health As Integer 'is the characters current health at any given point in time
level As Integer
parry As Integer 'the characters chance at blocking an attack
turnspeed As Integer 'should be calcualted on the fly based on your speed against your opponants
money As Double
End Type
Public CI As charinfo

Public Sub LevelCheck()
CI.expleftover = CI.exphave - CI.expneed 'the carry over of the leftover experiance points you had from the last battle'
If CI.expneed <= CI.exphave Then
CI.skillpoints = CI.skillpoints + 2
FRMstats.CMDaddstrength.Visible = True  ' And all other skill up command buttons
FRMstats.CMDremovestrength.Visible = True

'all other stat raise buttons'
CI.totalexp = CI.totalexp + CI.exphave
CI.skillpoints = CI.skillpoints + (1 + (0.25 * level)) 'This makes it so you don't lose unspent points if you go two levels before spending'
CI.exphave = 0 + CI.expleftover 'The one ensures we keep the original amount, .05 gives us 5% more added to it'
CI.expneed = 1.05 * CI.expneed 'this makes the experiance you need per next level 5 percent higher than the last'
End If
End Sub
Public Sub addstrength() 'increases the damage dealt by player
CI.strength = CI.strength + 1
CI.mindamage = CI.mindamage + 1
CI.maxdamage = CI.maxdamage + 2
FRMstats.LBLstrength = CI.strength
End Sub
Public Sub removestrength() 'decreases the damage dealt by player
CI.strength = CI.strength - 1
CI.mindamage = CI.mindamage - 1
CI.maxdamage = CI.mindamage - 2
FRMstats.LBLstrength = CI.strength
End Sub
Public Sub addendurance() 'increases the players full health amount
CI.endurance = CI.endurance + 1
CI.MaxHealth = CI.MaxHealth + 5
FRMstats.LBLendurance = CI.endurance
End Sub
Public Sub removeendurance() 'decreases the players full health amount
CI.endurance = CI.endurance - 1
CI.MaxHealth = CI.MaxHealth - 5
FRMstats.LBLendurance = CI.endurance
End Sub
Public Sub addintelect() 'increases the players magic power
CI.intelect = CI.intelect + 1
FRMstats.LBLintelect = CI.intelect
'needs fixed

End Sub
Public Sub removentelect() 'decreases the players magic power
CI.intelect = CI.intelect - 1
FRMstats.LBLintelect = CI.intelect
'needs fixed

End Sub
Public Sub adddexterity() 'increases the players chance to block an attack
CI.dextersity = CI.dexterity + 1
CI.parry = CI.parry + 2
FRMstats.LBLdexterity = CI.dexterity
End Sub
Public Sub removedexterity() 'decreases the players chance to block an attack
CI.dextersity = CI.dexterity - 1
CI.parry = CI.parry - 2
FRMstats.LBLdexterity = CI.dexterity
End Sub
Public Sub addagility() 'adds more chance for the player to block an attack
CI.agility = CI.agility + 1
FRMstats.LBLagility = CI.agility
End Sub
Public Sub removeagility() 'removes more chance for the player to block an attack
CI.agility = CI.agility - 1
FRMstats.LBLagility = CI.agility
End Sub
Public Sub addspeed() 'increases the chance for the player to attack multiple times per turn
CI.speed = CI.speed + 1
CI.turnspeed = CI.turnspeed + 1
FRMstats.LBLspeed = CI.speed
End Sub
Public Sub removespeed() 'decreases the chance for the player to attack multiple times per turn
CI.speed = CI.speed - 1
CI.turnspeed = CI.turnspeed - 1
FRMstats.LBLspeed = CI.speed
End Sub




stats form where the player can view thier stats

Option Explicit


Private Sub CMDaddstrength_Click()
Stats.addstrength
CI.skillpionts = CI.skillpionts - 1
CI.strength = CI.strength + 1
LBLstrength = CI.strength
CI.spenstrength = 1
End Sub

Private Sub CMDgame_Click()
CMDtestertools.Visible = False
Unload Me
Game_window.Show
End Sub

Private Sub CMDremovestrength_Click()
Stats.removestrength
CI.skillpoints = CI.skillpoints + 1
CI.strength = CI.strength - 1
LBLstrength = CI.strength
CI.spentstrength = 0
End Sub

Private Sub CMDtestertools_Click()


FRMstats.Visible = False
FRMtestertools.Visible = True
CMDtestertools.Visible = False
'Stats.CI.previouspage = ""
End Sub

Private Sub Form_Load()
CMDaddstrength.Visible = False
CMDremovestrength.Visible = False
'rest of buttons here
LBLstrength = Stats.CI.strength
LBLendurance = Stats.CI.endurance
LBLmindamage = Stats.CI.mindamage
LBLintelect = Stats.CI.intelect
LBLdexterity = Stats.CI.dexterity
LBLagility = Stats.CI.agility
LBLspeed = Stats.CI.speed
LBLparry = Stats.CI.parry
LBLexphave = Stats.CI.exphave
LBLexpneed = Stats.CI.expneed
LBLmaxdamage = Stats.CI.maxdamage
LBLmaxhealth = Stats.CI.MaxHealth
LBLhealth = Stats.CI.health
LBLmoney = Stats.CI.money
End Sub



[attachment=26030:FRMstats.jpg]


login form

Private Sub CMDlogin_Click()
Dim file As String
fileops.clear
username = TXTusername.Text
If OPTclass(0) Then
Stats.CI.speciesname = "human"
Else
If OPTclass(1) Then
Stats.CI.speciesname = "ork"
Else
If OPTclass(2) Then
Stats.CI.speciesname = "pyromancer"
Else
If OPTclass(3) Then
Stats.CI.speciesname = "golem"
Else
If OPTclass(4) Then
Stats.CI.speciesname = "goblin"
Else
If OPTclass(5) Then
Stats.CI.speciesname = "troll"
Else
If OPTclass(6) Then
Stats.CI.speciesname = "dwarf"
Else
If OPTclass(7) Then
Stats.CI.speciesname = "elf"
End If
End If
End If
End If
End If
End If
End If
End If

file = (App.path & "\" & Stats.CI.charactername & " the " & Stats.CI.speciesname & ".txt")

'Else
'    MsgBox ("Please enter a username")
If TXTusername.Text <> "" And TXTpassword.Text <> "" Then
    Stats.CI.charactername = username
    'shroud.decrypt (App.path & "/" & Stats.CI.charactername & " the " & Stats.CI.speciesname & ".txt")
    fileops.load (App.path & "/" & Stats.CI.charactername & " the " & Stats.CI.speciesname & ".txt")
    FRMlogin.Hide
    Game_window.Show
Else
    MsgBox ("Please check and retype password")
    TXTpassword.Text = ""
    TXTpassword.BackColor = vbRed
    End If
End Sub


Private Sub Form_Load()

End Sub


[attachment=26031:FRMlogin.jpg]



game window itself, where the player actually plays the game

Option Explicit
Dim path As String


Private Sub CMDlogout_Click()
path = (App.path & "/" & Stats.CI.charactername & " the " & Stats.CI.speciesname & ".txt")

Kill (path)
fileops.save (App.path & "/" & Stats.CI.charactername & " the " & Stats.CI.speciesname & ".txt")
fileops.clear
End Sub

Private Sub CMDsend_Click()
Dim chattext As String
chattext = Game_window.TXTchat
If TXTchat.Text = "testertools" Then
    Game_window.TXTchat = ""
    chattext = ""
    FRMtestertools.Show
    Game_window.Hide
Else
        If chattext = "clear" Then
            Game_window.TXTchat = ""
            Game_window.LBLchat = ""
        Else
            Game_window.LBLchat = Game_window.LBLchat & chattext & ".  "
            Game_window.TXTchat = ""
            chattext = ""
        End If
End If
End Sub

Private Sub CMDstats_Click()
FRMstats.Show
Game_window.Hide
End Sub

Private Sub Form_Load()
LBLusername = Stats.CI.charactername
LBLexphave = Stats.CI.exphave
LBLexpneeded = Stats.CI.expneed
End Sub



[attachment=26032:Game_window.jpg]




heres hoping one of you fellow coders can see what I must be overlooking... because it has apparently been too long since I last programmed for me to be able to notice the issue... thankfully enough for myself, my college does offer what I believe is a microsoft visual studios programming course and I will be taking that I believe this winter quarter, and I can't wait... because this will help me immensely... so thank you once again for any and all help...

I also think that I will try and attach the pictures of the forms as well...

my first attempt at attaching a form file...

Is This A Good Question/Topic? 0
  • +

Replies To: overflow errors in the vb rpg again

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5316
  • View blog
  • Posts: 11,355
  • Joined: 02-June 10

Re: overflow errors in the vb rpg again

Posted 13 October 2011 - 03:07 PM

Putting all the 'explanation' that has nothing to do with the code aside...

what's the actual problem? "Stack overflow" ??
Generally that is from an infinite loop, or infinate recurrsion of some kind.

A calls B
B calls A

Stack overflow

Debug it using breakpoints and the F10 key until you find where you have this type of looping.

See FAQ #5


FAQ (Frequently Asked Questions - Updated Sep 2011

Spoiler

Was This Post Helpful? 0
  • +
  • -

#3 mapmd1234  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 140
  • Joined: 04-December 09

Re: overflow errors in the vb rpg again

Posted 13 October 2011 - 08:09 PM

generally I would agree with you on that, because that is the most common cause for such a thing, but the problem is not that, the problem that I am running into, is that somewhere, when logging out of the game itself, not the program, the stats are not clearing right before they are getting saved... IE: if strength is 5 in the game, when logging out, and the saved data being processed, somehow no mater what I try, the strength stat of 5, goes from 5 in the save file, and thus the game, to 55, and this happens to every single stat that gets saved and loaded, and when this happens 2 times, that is when the game gives me the overflow error, because the data being loaded is too large... the problem that I need help to find, is what part of my code is doing this error, and causing this issue to happen...

so normally, I would instantly agree with you on that, but that just is not the case in this instant... thank you for your help none the less however...
Was This Post Helpful? 0
  • +
  • -

#4 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,755
  • Joined: 26-March 09

Re: overflow errors in the vb rpg again

Posted 13 October 2011 - 10:34 PM

Don't want to sound pedantic here, but you have asked this question a couple of times in various forms this year. If you had posted your solution that fixed it as a follow up one of your questions, then not only would it help others in a similar situation in furute, but it would have also served to help yourself, as you could have looked back through the posts on here to answer your own question.

Sorry, I don't mean to kick you when you're down, but it shows that following up questions with a solution, if you find one, is a benefit for all.

Can you identify where exactly you get the overflow error and in which "stat" variable it is, as you have three named very similar. Thanks.
Was This Post Helpful? 2
  • +
  • -

#5 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5316
  • View blog
  • Posts: 11,355
  • Joined: 02-June 10

Re: overflow errors in the vb rpg again

Posted 14 October 2011 - 06:51 AM

View Postmapmd1234, on 13 October 2011 - 09:09 PM, said:

the strength stat of 5, goes from 5 in the save file, and thus the game, to 55,


The in it fairly obvious. You are converting numeric values to string someplace. Then either in the save or load you are adding the value to itself.

If a saved 5 and a loaded five result in 10 (double) then you would know it was happening while the value is still a number. But "5" + "5" = "55"

If you look at the vales in the saved file and see the actual saved vale is still "5" then you know it is happening at load. If the value stored in the file is "55" then you know it is happen at save.

Considering you should only have 1 save method, 1 load method, and one property holding the score, there can't be that many places to look. Again, put a breakpoint at the start of the load method, start of the save method, and at the get off the score property and you should find this in minutes. Again, this goes back to basic debugging techniques.

Suggestions:
If you follow some standard OOP principals and make classes for each of your species you will have a lot more freedom as you expand the game and not have to play silly games of if...else if... elseif... just to get a species name.
06
Stats.CI.speciesname = "human"
07 Else
08 If OPTclass(1) Then
09 Stats.CI.speciesname = "ork"
10 Else
11
If OPTclass(2) Then
12 Stats.CI.speciesname = "pyromancer"



And if you used properties instead of fields for all your stats then the set method of the property would handle things like this automatically. You should NEVER have to make a ton of methods like "addAgility" when you can just set the property.
LBLintelect = Stats.CI.intelect

091 Public Sub addagility() 'adds more chance for the player to block an attack
092 CI.agility = CI.agility + 1
093 FRMstats.LBLagility = CI.agility
094 End Sub


Based on these really early rookie mistakes I would suggest you go back to working on tutorials and learn the coding a bit better before trying to undertake a project as big as a game. But if you choose to use this game project as a learning tool, then at least go learn new things and better ways and implement the new things learn into the project. Otherwise its not a learning project, is it?

This post has been edited by tlhIn`toq: 14 October 2011 - 06:52 AM

Was This Post Helpful? 0
  • +
  • -

#6 mapmd1234  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 140
  • Joined: 04-December 09

Re: overflow errors in the vb rpg again

Posted 14 October 2011 - 02:29 PM

View Postmaj3091, on 13 October 2011 - 11:34 PM, said:

Don't want to sound pedantic here, but you have asked this question a couple of times in various forms this year. If you had posted your solution that fixed it as a follow up one of your questions, then not only would it help others in a similar situation in furute, but it would have also served to help yourself, as you could have looked back through the posts on here to answer your own question.

Sorry, I don't mean to kick you when you're down, but it shows that following up questions with a solution, if you find one, is a benefit for all.

Can you identify where exactly you get the overflow error and in which "stat" variable it is, as you have three named very similar. Thanks.


the stat(s) that this is happening in is every single stat other than the name and password...

and tlhIn`toq, I am planning on using this project as a learning experience, but sadly, my programming partner is the brains behind this project, and I am trying to learn both as I go and from his coding as well... and most of the advanced ideas that I have used in this project have either been made and implemented by my programming partner, or by nobrain... but 90% of everything we use in this project, I do, or did understand, and 99% of the time when I have a problem, I do follow up with a reply stating what I did to fix the problem, the exception to this being this last post of this problem... for some odd reason, this being the first time, I did not post back with the fix I used... I'm not sure why I did not do this this last time... and sadly, I did not understand quite what you were saying...however, the next time I have a large amount of free time, I will be reading up on the topics you posted links to...

also, the stat of 5 going to 55 happens both in the save file, and the game...

This post has been edited by mapmd1234: 14 October 2011 - 02:30 PM

Was This Post Helpful? 0
  • +
  • -

#7 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,755
  • Joined: 26-March 09

Re: overflow errors in the vb rpg again

Posted 15 October 2011 - 01:35 AM

You might want to look at the following code in the Load function

Sstat(x) = Sstat(x) + letter


You're adding a string to a string (pretty much what tlhIn`toq said in the last post)

Try changing it to:

Sstat(x) = cstr(val(Sstat(x)) + val(letter))


This should now take the value of Sstat and add the value of letter. You may need to handle the fact that Sstat(x) might be an empty string, unless you initialise it to zero sometwhere else.

See if that helps.

This post has been edited by maj3091: 15 October 2011 - 01:36 AM

Was This Post Helpful? 0
  • +
  • -

#8 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 571
  • View blog
  • Posts: 2,979
  • Joined: 19-May 09

Re: overflow errors in the vb rpg again

Posted 15 October 2011 - 01:32 PM

By the way, this code
                If letter = "1" Or letter = "2" Or letter = "3" Or letter = "4" Or letter = "5" Or letter = "6" Or letter = "7" Or letter = "8" Or letter = "9" Then
can be much more succinctly written this way:
if instr("123456789", letter) <> 0 then

Was This Post Helpful? 0
  • +
  • -

#9 mapmd1234  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 140
  • Joined: 04-December 09

Re: overflow errors in the vb rpg again

Posted 15 October 2011 - 03:52 PM

thank you two for your input... the code in question that you two are specifying are the works of my programming partner, but I will definitely try both suggestions, and get back to you all on whether they worked or not...again, thank you for your input and help on this problem...
Was This Post Helpful? 0
  • +
  • -

#10 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,755
  • Joined: 26-March 09

Re: overflow errors in the vb rpg again

Posted 15 October 2011 - 03:57 PM

View PostBobRodes, on 15 October 2011 - 02:32 PM, said:

By the way, this code
                If letter = "1" Or letter = "2" Or letter = "3" Or letter = "4" Or letter = "5" Or letter = "6" Or letter = "7" Or letter = "8" Or letter = "9" Then
can be much more succinctly written this way:
if instr("123456789", letter) <> 0 then


Or you could use...

if IsNumeric(letter) then

Was This Post Helpful? 0
  • +
  • -

#11 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 571
  • View blog
  • Posts: 2,979
  • Joined: 19-May 09

Re: overflow errors in the vb rpg again

Posted 15 October 2011 - 05:22 PM

That would work if there were no value "19" (for example) that were not supposed to meet the criteria. :) Now that I've said that, I should amend my code to exclude "12", for example.
If InStr("_1_2_3_4_5_6_7_8_9_") <> 0 Then
Between the two of us, maj, it looks like we can come up with a valid solution. :)
Was This Post Helpful? 0
  • +
  • -

#12 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,755
  • Joined: 26-March 09

Re: overflow errors in the vb rpg again

Posted 16 October 2011 - 03:58 AM

Yeah, I think we got it covered between us....(I've never seen the underscore technique before, so I'll look into that one myself!).

The Mid function is only extracting a single char, so both original statements should be good! ;)
Was This Post Helpful? 0
  • +
  • -

#13 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 571
  • View blog
  • Posts: 2,979
  • Joined: 19-May 09

Re: overflow errors in the vb rpg again

Posted 21 October 2011 - 08:39 PM

I've never seen it before either, but hey, I'm creative. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1