473,573 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to declare more than one variable

I have several variabls that are strings.
How can I put them on one line.
I remember that if you do that, only the last one is the string and the ones
before it are not

like
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan
Nov 12 '05 #1
4 4954
Am Tue, 13 Apr 2004 15:51:21 +0000 schrieb Danny:
I have several variabls that are strings.
How can I put them on one line.
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan

Hello,

you have to declare the type of each variable explicit.
You have to type:

Dim a as string, b as string, c as string
HTH

Karpi
<fluctuat nec mergitur>
Nov 12 '05 #2
Danny wrote:
I have several variabls that are strings.
How can I put them on one line.
I remember that if you do that, only the last one is the string and the ones
before it are not

like
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan


dim a as string, b as string, c as string

I don't code like this,so I'm not sure you need the commas.

Ron

--
Ronald W. Roberts
Roberts Communication
rw************* ******@robcom.c om
To reply remove "_at_robcom_dot _com"

Nov 12 '05 #3
Thanks

is there any other option?
Do you guys use the option explicit to force correct syntax?

Thanks

"Danny" <da********@hot mail.com> wrote in message
news:Z%******** *************@n ews4.srv.hcvlny .cv.net...
I have several variabls that are strings.
How can I put them on one line.
I remember that if you do that, only the last one is the string and the ones before it are not

like
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan

Nov 12 '05 #4
You should always use option explicit imo, cant do any harm to prevent
any extra errors in your code

dim a as string, b as string, c as string

or

dim a as string
dim b as string
dim c as string

what other options are you looking for?
"Danny" <da********@hot mail.com> wrote in message news:<4J******* **************@ news4.srv.hcvln y.cv.net>...
Thanks

is there any other option?
Do you guys use the option explicit to force correct syntax?

Thanks

"Danny" <da********@hot mail.com> wrote in message
news:Z%******** *************@n ews4.srv.hcvlny .cv.net...
I have several variabls that are strings.
How can I put them on one line.
I remember that if you do that, only the last one is the string and the

ones
before it are not

like
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan

Nov 12 '05 #5

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

Similar topics

6
677
by: David T. Ashley | last post by:
Hi, In my project, I typically declare and define variables in the .H file, i.e. DECMOD_MAIN UINT8 can_message_201_status_global #ifdef MODULE_MAIN = HAS_NEVER_BEEN_RECEIVED #endif ;
6
19050
by: rick | last post by:
Noob problem. I prefer to keep all my scripts in an external '.js' file. I am currently loading the external '.js' file from the header. Problem is I would like to declare a global variable in the external file, but I keep getting an error about the object does not exist. Can someone tell me where or how to declare a global variable in an...
2
2093
by: Jeff Higgins | last post by:
I would like to use a string variable to declare a variable. How would I accomplish this goal? string nameMainMenu = "mnuMain"; string nameMenuItem = "mnuFile"; MainMenu {nameMainMenu} = new MainMenu(); this.Menu = {nameMainMenu}; MenuItem {nameMenuItem} = new MenuItem("&File"); {nameMainMenu}.MenuItems.Add({nameMenuItem});
6
2125
by: **Developer** | last post by:
Notice below I sometimes used the "A" version. I found by cut-and-try that only the "A" version would work correctly. Anyone have a suggestion of why the "W" version would not work correctly? One reason is that the ByRef or ByVal does not show by InteliSence so the "p" would help there. ------ Secondly, I'd like to be consistent with...
8
10151
by: redefined.horizons | last post by:
I would like to have an array declaration where the size of the array is dependent on a variable. Something like this: /* Store the desired size of the array in a variable named "array_size". */ unsigned short int array_size = 25; /*Declare an array named "numbers" using the variable initialized above. */ unsigned short int numbers;
20
224999
by: Manuel | last post by:
hi, I have a problem, a stupid problem. I can't declare a variable of type byte. The g++ said that i have syntactic error in this line. The code is this: byte * variable; well, i think that the mistake is a stupidity but i don't find it. where is it?
14
19005
by: Ron | last post by:
I want to decalre and fill an array with some numbers, 5, 7, 8, 9, 0 do I just do this: Dim myarray as int = (5,7,8,9,0) if not how would i do this? thanks.
1
2775
by: ares.lagae | last post by:
- I have a typelist and I want to declare a member variable for each of the types. How can I do that? E.g. I have the typelist "typedef boost::mpl::vector<int, float> types;" and I want to declare member variables with type "int" and "float". - I have a typelist and I want to declare a variable based on each of the types types. How can I...
0
8294
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new records there is an error "Incorrect syntax near '-'. Must declare the scalar variable "@UserName". I worked out in design view,code is automatically...
0
2791
by: FLANDERS | last post by:
Hi all, Is it possible to declare a SQL type of result set or similar? I want to do use the IN predicate like you can in a non-procedural SQL like this: UPDATE TABLE1 SET COL1 = 123 WHERE COL2 IN (SELECT COL3 FROM TABLE2) I want to do this in procedural SQL, but I only want to use one cursor. So to do this I have declared a cursor for...
0
7750
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7989
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8182
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7744
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6369
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3708
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3708
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2170
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.