Results 1 to 3 of 3

Thread: Ini Problems In A Hurry asap

  1. #1

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    Well as you can see I am back into fooling around with ini files. I am making a program for some of my teachers. It is a vocab builder. They can create and open up ini files full of vocab words and definitions. Then they can use another part of the prog to let there students practice and it will randomly choose a vocab word and ask for its def. Well you guys get where this is heading. So I ran into this little problem. If they go to create a ini file with the same name as an older one it will combine the two and thats not good. So I put in the ini file a special little thing that only my vocab ini files will have so if the program looks and sees that it is there it will tell you to change the name and if it can't find it then it will create it. I can't get it to detect it thoughthis is my code:

    Option Explicit
    Dim path As String
    Dim check As String

    Private Sub Form_Load()
    path = App.path & IIf(Right$(App.path, 1) = "\", "", "\")
    File1.path = path & "Vocab Lists\"
    End Sub

    Private Sub Command2_Click()
    lpAppName = "Chris Rysdyk's Vocab Builder List"
    lpKeyName = "Chris"
    lpDefault = path & "Vocab Lists\" & Text1.Text & ".ini"
    lpFileName = path & "Vocab Lists\" & Text1.Text & ".ini"
    ret = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, Temp, Len(Temp), lpFileName)
    If ret = 0 Then
    Beep
    Else
    check = Trim(Temp)
    End If
    Label1.Caption = check
    If check = "True" Then
    MsgBox "There is already a vocab list with the name " & Text1.Text & " please change to a different name", vbOKOnly, "Error Creating File"
    Else
    MsgBox "File was created"
    End If
    End Sub

    This is what is in my ini file
    [Chris Rysdyk's Vocab Builder List]
    Chris=True

    Does anyone see what I did wrong? Please help me!!! Thanks


    ------------------
    Sincerely,
    Chris
    :-) ;-)
    just have fun out there and live life to the fullest while it is still here
    Email [email protected]


  2. #2

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    Please someone help me I am working on it as we speak and this is driving me crazy help!!!!

    ------------------
    Sincerely,
    Chris
    :-) ;-)
    just have fun out there and live life to the fullest while it is still here
    Email [email protected]


  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Have you stepped through the code with the debugger and checked to see what is happening at each line?

    ------------------
    Marty
    Why is it called lipstick if you can still move your lips?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width