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
Printable View
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
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
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
I'm not sure if it is a good way, but I would rewrite it like this:
SECOND OPTIONCode: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
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):
After that add this code at the end of your Intro: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
You might have to change something, but this is the way I would approach this problemCode:frmMain.Show
Unload Me
HTH :)
[Edited by QWERTY on 04-04-2000 at 11:05 PM]