473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Two Relatively Simple Questions

First,

I have four Visual Basic .Net projects in my Visual Studio solution. Each
project modifies and/or uses information in four random access files in
different ways. Hence a large portion of code is shared between two or more
of these four projects.

This leads to difficulties, since modifications to code in one project must
be mirrored in the other projects to prevent bugs & errors. For example, I
eventually traced one nasty bug that caused a display error in a ListBox to
my failure to modify a <VBFixedString(15)> that I'd increased to 17 in the
other projects.

Can I solve this by adding the same module to each of my four projects and
declaring variables common to all of them only in there?

(Would this also allow me to have routines common to all projects?)

Second,

I reference those four files using the following constants:

Const PointsFile = "C:\Bike Racer\Shared Data\Points.dat"
Const SegmentsFile = "C:\Bike Racer\Shared Data\Segments.dat"
Const RoadsFile = "C:\Bike Racer\Shared Data\Roads.dat"
Const ConfigFile = "C:\Bike Racer\Shared Data\Config.dat"

This, of course, means that the programs must always be installed to C:
\Bike Racer to run...

How would I set them equal to
"[Directory Application is Installed In] & "\Shared Data\[?????].dat"

Thanks in advance for any assistance,

The Confessor
Jan 11 '06 #1
4 891
Well, Yes I am sure you can have a common module in all the four projects.
Just add that module to your project.

For the second problem, use this: -

Application.StartupPath

Cheers
Cyril
Jan 11 '06 #2
"Cyril Gupta" <no****@mail.com> wrote in
news:#Y**************@TK2MSFTNGP12.phx.gbl:
Well, Yes I am sure you can have a common module in all the four
projects. Just add that module to your project.

For the second problem, use this: -

Application.StartupPath

Cheers
Cyril


Thank you, Cyril... my guess had been IO.Directory.GetCurrentDirectory, but
I was hoping for something that would allow me to keep declaring them as
constants rather than variables (since they *are* constant once declared),
but that ain't gonna happen, is it?

As for my problem of reproduced code (specifically, declarations)...

Well, when I declare my variables in a common module which I've added to
each project and subsequently remove the declarations in each specific
project, they don't seem to recognized the declarations in the module...

Is there any way to tell Visual Basic to basically "Look *here* for more
declarations"?
Jan 11 '06 #3
The Confessor <in*****@reply.to.group> wrote in
news:Xn*********************************@130.81.64 .196:
Thank you, Cyril... my guess had been
IO.Directory.GetCurrentDirectory, but I was hoping for something that
would allow me to keep declaring them as constants rather than
variables (since they *are* constant once declared), but that ain't
gonna happen, is it?

As for my problem of reproduced code (specifically, declarations)...

Well, when I declare my variables in a common module which I've added
to each project and subsequently remove the declarations in each
specific project, they don't seem to recognized the declarations in
the module...

Is there any way to tell Visual Basic to basically "Look *here* for
more declarations"?


Uh, just to preempt any reply...

I'm an idiot.

The variables must, of course, be declared as Public in the module to be
accessed by the form.

Thanks for you help, Cyril.
Jan 11 '06 #4
The Confessor <in*****@reply.to.group> wrote in
news:Xn*********************************@130.81.64 .196:
I'm an idiot.

The variables must, of course, be declared as Public in the module to be
accessed by the form.

Thanks for you help, Cyril.


One further caveat: When you attempt to add the existing module to your
other projects, you must *link* to it. Otherwise, a copy of the current
version of the module will simply be placed in your project's directory,
and you'll be left with the same problem as before: modifying four
different files instead of one.
Jan 11 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I...
10
by: Tom Cole | last post by:
While I've done javascript work for as long as I can remember (since Netscape first released it), I've only ever used it for trivial things, change a color here, validate a text element there, blah...
7
by: javedna | last post by:
Hi guys Ive got a simple problem, im designing an online questionnaire and on submission the coding that I have used to validate whether a user has filled in all the questions is supposed to...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
4
by: maheshgupta0248 | last post by:
Hi all, Im a newbie in php, started learning php on my own. I want to create small website using php, that contains links for two simple webpages > C questions > C++ questions C questions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.