|
-
Apr 4th, 2000, 08:19 AM
#1
Thread Starter
Junior Member
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
-
Apr 4th, 2000, 09:12 AM
#2
Lively Member
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
-
Apr 4th, 2000, 09:23 AM
#3
Thread Starter
Junior Member
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
-
Apr 4th, 2000, 10:03 AM
#4
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|