Results 1 to 14 of 14

Thread: [SOLVED]"Variable not defined" error

Threaded View

  1. #1

    Thread Starter
    Addicted Member vigge89's Avatar
    Join Date
    May 2002
    Location
    Sweden
    Posts
    172

    [SOLVED]"Variable not defined" error

    I've set the variable "WhichFav" to the Index of a control, and when i execute this:
    VB Code:
    1. Call saveini("favorites", WhichFav)

    I get error saying: "Variable not defined" in the function saveini().

    Contents of saveini():
    VB Code:
    1. Private Function saveini(KeySection As String, KeyKey As String)
    2.  
    3. Dim lngResult As Long
    4. Dim strFileName
    5. strFileName = App.Path & "\options.ini"
    6. lngResult = WritePrivateProfileString(KeySection, _
    7. KeyKey, KeyValue, strFileName)
    8. If lngResult = 0 Then
    9. 'An error has occurred
    10. Call MsgBox("An error has occurred while saving the options", vbExclamation)
    11. End If
    12. KeyValue = Trim(strResult)
    13. End Function

    What is wrong?
    Could it be that WhichFav is an integer?
    I've tried CStr(WhichFav) but that doesn't work either, same error
    Last edited by vigge89; Dec 1st, 2003 at 01:19 PM.


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