Error while saving to reg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Error while saving to reg

  1. #1
    Bryan Guest

    Error while saving to reg


    HI,
    I have found a different way to save to the reg but when I try to use it
    I get a error
    Error:
    Compile Error:
    Sub or function not defined.

    I have been looking forever for a answer to fix this. I will post my code
    so you can see what I did wrong!

    Code:

    Private Sub Form_Load()
    File1.ForeColor = GetSettings("application expert", "user1", "Font", "file1.forecolor
    = black")
    Debug.Assert File1.ForeColor
    End Sub

    for the save settings I have:

    Private Sub Command4_Click()
    Savesettings "Smart Erase", "user1", "Font", "frmsmrt.file1.forecolor = label1.forecolor"
    End Sub

    Thank you in advance once again
    -Bryan


  2. #2
    Rick Rothstein Guest

    Re: Error while saving to reg

    The keywords are GetSetting and SaveSetting -- no "s" on the end of either of them.

    However, I don't think you are using them correctly. You appear to be trying to save the
    command line you would use inside the program rather than an actual *value*. Try something
    like this (off the top of my head)...

    SaveSetting "Smart Erase", "user1", "Font", Label1.ForeColor

    File1.ForeColor = GetSetting("Smart Erase", "user1", "Font", vbBlack)

    This uses the structure you provided in your sample; I note that you are storing the
    ForeColor of a Label and returning it to the ForeColor of a FileListBox. I presume that is
    what you intended.

    Rick


    "Bryan" <b_ride_j@hotmail.com> wrote in message news:3c92f9e5$1@10.1.10.29...
    >
    > HI,
    > I have found a different way to save to the reg but when I try to use it
    > I get a error
    > Error:
    > Compile Error:
    > Sub or function not defined.
    >
    > I have been looking forever for a answer to fix this. I will post my code
    > so you can see what I did wrong!
    >
    > Code:
    >
    > Private Sub Form_Load()
    > File1.ForeColor = GetSettings("application expert", "user1", "Font", "file1.forecolor
    > = black")
    > Debug.Assert File1.ForeColor
    > End Sub
    >
    > for the save settings I have:
    >
    > Private Sub Command4_Click()
    > Savesettings "Smart Erase", "user1", "Font", "frmsmrt.file1.forecolor =

    label1.forecolor"
    > End Sub
    >
    > Thank you in advance once again
    > -Bryan
    >



  3. #3
    Bryan Guest

    Re: Error while saving to reg


    thank you so much for the reply I figured it out, thanx again Rick
    -Bryan


    "Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote:
    >The keywords are GetSetting and SaveSetting -- no "s" on the end of either

    of them.
    >
    >However, I don't think you are using them correctly. You appear to be trying

    to save
    >the
    >command line you would use inside the program rather than an actual *value*.

    Try something
    >like this (off the top of my head)...
    >
    >SaveSetting "Smart Erase", "user1", "Font", Label1.ForeColor
    >
    >File1.ForeColor = GetSetting("Smart Erase", "user1", "Font", vbBlack)
    >
    >This uses the structure you provided in your sample; I note that you are

    storing the
    >ForeColor of a Label and returning it to the ForeColor of a FileListBox.

    I presume that
    >is
    >what you intended.
    >
    >Rick
    >
    >
    >"Bryan" <b_ride_j@hotmail.com> wrote in message news:3c92f9e5$1@10.1.10.29...
    >>
    >> HI,
    >> I have found a different way to save to the reg but when I try to use

    it
    >> I get a error
    >> Error:
    >> Compile Error:
    >> Sub or function not defined.
    >>
    >> I have been looking forever for a answer to fix this. I will post my

    code
    >> so you can see what I did wrong!
    >>
    >> Code:
    >>
    >> Private Sub Form_Load()
    >> File1.ForeColor = GetSettings("application expert", "user1", "Font", "file1.forecolor
    >> = black")
    >> Debug.Assert File1.ForeColor
    >> End Sub
    >>
    >> for the save settings I have:
    >>
    >> Private Sub Command4_Click()
    >> Savesettings "Smart Erase", "user1", "Font", "frmsmrt.file1.forecolor

    =
    >label1.forecolor"
    >> End Sub
    >>
    >> Thank you in advance once again
    >> -Bryan
    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center