Results 1 to 4 of 4

Thread: changing program settings

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    NJ
    Posts
    19
    hey whats up? in my program i want to be able to disable the intro. i can read and write to an ini file, but how would i use what i read from the ini file to skip the intro? thanks in advance!!


    ToNy HwK

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    76
    HI

    Iam puzzled at your Question.
    if u can read INI file so put a setting in INI for this like
    test_readinitinfo = true or false

    so after reading this into a variant variable
    if test_readinitinfo = True then
    ' Display or do whatever
    else
    ' ......
    endif

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    NJ
    Posts
    19
    heres the code im using


    Dim value As String
    value = IniString("options", "intro?", "tt.ini")
    If value = "no" Then GoTo nope: Else GoTo yup:
    yup:
    intro.Show
    Unload Me
    nope:
    Main.Show
    Unload Me

    what happens is both of them load(im very new at vb, so if this is one of the dumbest ways to do this tell me and please show me a good way).

    Thanks,
    ToNy HwK

  4. #4
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523
    I'm not sure if it is a good way, but I would rewrite it like this:
    Code:
    Dim stValue As String
    value = IniString("Options", "Intro?", "tt.ini")
    If stValue = "yes" Then
        Intro.Show
        Unload Me
    Else
        Main.Show
        Unload Me
    End If
    SECOND OPTION
    If you want the intro to load when your program starts then you could use this (it may be hard to explain though ) :
    Create two forms: frmIntro and frmMain. Add a module to your project and in that module create new sub called Sub Main. Then go to Project~~~~>Project1 Properties and change Start Up Object to Sub Main. Then add this code to your sub Main (as well as your code to read Ini file):
    Code:
    Option Explicit
    
    Sub Main()
        Dim stValue As String
        value = IniString("Options", "Intro?", "tt.ini")
        If stValue = "Yes" Then 'user wants the intro
            frmIntro.Show
        Else
            frmMain.Show
        End If
    End Sub
    After that add this code at the end of your Intro:
    Code:
    frmMain.Show
    Unload Me
    You might have to change something, but this is the way I would approach this problem
    HTH

    [Edited by QWERTY on 04-04-2000 at 11:05 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