|
-
Dec 4th, 2007, 09:01 PM
#1
Thread Starter
Lively Member
Calling Module variables.
I have to start off by saying that I'm used to working with VB 6.0 from high school and that experience has carried just about the whole way through my college course with a few hiccups here and there.
I believe I'm supposed to create a variable called mRaceName (should hold "Kentucky Derby"), and then read in the Horse information (1: Circular Quay, 9-5;Happy) in as an array.
This is one of the module strings:
Public Race01() As String = {"Kentucky Derby, derby.jpg", _
"1: Circular Quay, 9-5;Happy", _
"2: Stormello, 5-1;Bashful", _
"3: Cobalt Blue, 30-1;Snow White", _
"4: Crudacious, 6-5;Bozo", _
"5: Take Five, 5-1;Wet Willie", _
"6: Big Loser, 0-0;Duncell", _
"7: Bongo Monkey, 3-1;Bashful", _
"8: Tripoli, 21-1;Jack Beabstalk"}
The book I have doesn't discuss modules other than mention them as a "collection of code stored in one file"
Thank you very much for ANY help you can offer me.
Last edited by jrowe; Dec 4th, 2007 at 10:16 PM.
-
Dec 4th, 2007, 09:04 PM
#2
Re: Calling Module variables.
Welcome to the Forums.
Modules are just like they were in VB 6. Probably one of the few things that was retained.
You could use a collection in a class to dynamically add your items to it.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 4th, 2007, 09:07 PM
#3
Thread Starter
Lively Member
Re: Calling Module variables.
You'll have to forgive me, but I'm not very good with classes and I don't remember ever using a module in VB 6.0 the 4 years ago I had the class.
-
Dec 4th, 2007, 09:10 PM
#4
Re: Calling Module variables.
If you declare it as "Public" then it will be accessible throughout your app but usually not the best for OOP design/logic.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 4th, 2007, 09:14 PM
#5
Thread Starter
Lively Member
Re: Calling Module variables.
So are you saying I could just declare a variable called mRaceName and use a substr() fucntion to take the beginning section and put Kentucky Derby into the mRaceName value, or that I would need to take that Race1() string and read it into a public variable I declare in the Form code?
-
Dec 4th, 2007, 09:28 PM
#6
Thread Starter
Lively Member
Re: Calling Module variables.
I tried to put the string from the module into a global variable and got - Value of type '1-dimensional array of String' cannot be converted to 'String'.
Not really sure where to go from here.
-
Dec 4th, 2007, 10:04 PM
#7
Frenzied Member
Re: Calling Module variables.
That means your trying to set an array to a string, or a string to an array, can you post the code you got this error on please.
-
Dec 4th, 2007, 10:15 PM
#8
Thread Starter
Lively Member
Re: Calling Module variables.
the code I was getting it on I have fixed. I've actually figured out my problem for this part of the assignment at least. If I would have spent another 10 minutes tinkering I would have found it. Thank you to everyone who replied.
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
|