Jump to content

iniWrite an empty string


bigred
 Share

Recommended Posts

I seem to have a problem with iniWrite in VB6 when I try and write an empty string to the key.

Is there any way to clear out a key?

I could have the code replace an empty string with something that I could handle later when I go to read the string, but thats not preferable.

Any ideas?

Link to comment
Share on other sites

Ok, so you're saying set the string to one of those and then try and write it to the ini key?

I'll give it a try.

EDIT: Weird, it seems to have written "1 " (a one and a space) to the key when I use vbNull. Any ideas?

Also vbStringNull didn't work. VB6 thought it was a variable.

Edited by bigred
Link to comment
Share on other sites

vbStringNull is a variable, you could try sending that as your IniWrite parameter. I assume that in your code you set a string = vbNull, try changing its data type to a variant and see if that works. other than that without seeing your code there isn't a lot I can do to help. Hope something here was of assitsance!

*** Matt @ MPCS

Link to comment
Share on other sites

vbStringNull is a variable? I don't understand how that is helpful here?

No I don't set the string to equal vbNull, when I do that it writes a "1" to the key.

Here's the chunk of code I'm reffering too.

If ListSelMaps.ListIndex = -1 Then Exit Sub
    For iCounter = 0 To ListSelMaps.ListCount - 1
        ListSelMaps.Selected(iCounter) = False
        ListSelMaps.Selected(iCounter) = True
        If ListSelMaps.Selected(iCounter) = True Then
            Select Case iGameMode
                Case 1
                    sDA_Maps = sDA_Maps & ListSelMaps.Text & ","
                Case 2
                    sLC_Maps = sLC_Maps & ListSelMaps.Text & ","
                Case 3
                    sDM_Maps = sDM_Maps & ListSelMaps.Text & ","
            End Select
        End If
        ListSelMaps.Selected(iCounter) = False
    Next iCounter

    Select Case iGameMode
        Case 1
            If sDA_Maps = "" Then
                aix.IniWrite sTSMdata, "MAPS", "DiscArenaSelected", sDA_Maps
                Exit Sub
            Else
                aix.IniWrite sTSMdata, "MAPS", "DiscArenaSelected", sDA_Maps
            End If
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...