473,394 Members | 1,865 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,394 software developers and data experts.

How to declare variables in vb.net?

Public Class Class1
Dim strName As String
Public Function strReturnSupplierName() As String
'After process
Return strName
End Function
Public Function strReturnCustomerName() As String
'After process
Return strName
End Function
Public Function strReturnClientName() As String
'After process
Return strName
End Function
End Class


1. comment this is right way ro wrong way variable declaration
2. Is any memory allocation taking place when the class call?
3. How is memory allocated variable?
4. How does effect life and scope of the variable ?
5. How does it effect in the performace in programming coding?
Jan 10 '08 #1
2 2334
r035198x
13,262 8TB
Public Class Class1
Dim strName As String
Public Function strReturnSupplierName() As String
'After process
Return strName
End Function
Public Function strReturnCustomerName() As String
'After process
Return strName
End Function
Public Function strReturnClientName() As String
'After process
Return strName
End Function
End Class


1. comment this is right way ro wrong way variable declaration
2. Is any memory allocation taking place when the class call?
3. How is memory allocated variable?
4. How does effect life and scope of the variable ?
5. How does it effect in the performace in programming coding?
Please read our guidelines concerning posting homework questions.
Jan 10 '08 #2
debasisdas
8,127 Expert 4TB
Your question is too mch theoritical and is beond the scope of this discussion. Kindly follow some good book for the purpose or you can easily find all that by investing some time in web searching.
Jan 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
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
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...
8
by: Johm | last post by:
In my codes i am often referring to one and the same controls.Is it possible to declare these controls only once and then insert them in all my functions and subs? For example, i am often...
41
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
6
by: Jakob Bieling | last post by:
Hi, I recently noticed that my compiler (VC++7.1) allows me to declare variables inside the expression for an if-statement, like so: if (int i = 0) { i = 1; }
6
by: Michael | last post by:
Hi. I am trying to declare variables based on DB column. I have a table with 2 columns: "varname" and "varvalue". values for example: varName: 'varPhone' varValue: '450-111-2222' During the...
0
by: stevemcdee | last post by:
I am trying to duplicate an applications processes in SSIS, and am having trouble in declaring variables for output. I want to fire off a stored procedure with variables derived from data in an...
1
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...
9
by: johnlim20088 | last post by:
Hi, Hi, currently I developing an application in C# NET, let say i have a page call viewrecord.aspx, in this page, i have a global variables declared before the page_Load, so all function can...
5
by: dancer | last post by:
Using ASP.net 1.1 and VB Is it possible to declare variables in their own subroutine? I had my DIM statements within a sub that worked just fine. I wanted to be able to use them in another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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
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,...
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
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...

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.