Forum Moderators: open

Message Too Old, No Replies

Strings

\\their use\\

         

cmatcme

4:30 pm on Mar 11, 2005 (gmt 0)

10+ Year Member



Heard of them, played games with them, tied knots with them, now asp has them?

So what are they used for?

lZakl

5:46 pm on Mar 11, 2005 (gmt 0)

10+ Year Member



string:

In programming, a contiguous set of alphanumeric characters that does not contain numbers used for calculations. Names, addresses and error messages are examples of strings. Contrast with numeric data.

The definition came from Techweb

A string is a collection of characters usuallly stored in a variable.

Var = "This is the string"

So this line of code:

Public imagePath As String

Would tell the server that whatever is stored in the variable "imagePath" would be a string. Thus telling the server that there is no numeric characters that need calculating, no booleans (true-false statements)... Just characters.

Did I explain this right? lol

-- Zak

cmatcme

7:16 pm on Mar 11, 2005 (gmt 0)

10+ Year Member



So, a string is a fancy term for a variable which is not going to be used for calculating

Example:

variableX = "This is a String aka a variable" 'Correct?

These alphanumeric characters from VariableX need not be calculated?

Public VariableX As String 'Correct?

---------------

In short a string using Public As String is an alphanumeric variable that need not be calculated

'Correct?

TheNige

7:27 pm on Mar 11, 2005 (gmt 0)

10+ Year Member



yes.

cmatcme

7:35 pm on Mar 11, 2005 (gmt 0)

10+ Year Member



Thanks all.
Page bookmarked.
I know I'll forget this in 3 weeks time, I always do.

:)

mattglet

12:44 am on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



variableX = "This is a String aka a variable" 'Correct?

Just to be clear, "... aka a variable" (the description) is incorrect. A variable is the holder of the string value. So, variableX is the variable, while "This is a String", is the string.

I may be incorrectly assuming what you were trying to say, just trying to make this as clear as possible.

lZakl

1:09 am on Mar 12, 2005 (gmt 0)

10+ Year Member



mattglet, is correct... VariableX can only contain or represent (depending on your point of view) the string.

What makes the contents of VariableX a string, is the fact that they are simple characters, and serve no other purpose than ... Just being characters.

-- Zak

Easy_Coder

4:24 am on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



variableX = "This is a String aka a variable"

being a string isn't it a reference type so variableX would actually hold a reference to a memory location on the heap where "This is a String aka a variable" would be stored?

cmatcme

8:45 am on Mar 12, 2005 (gmt 0)

10+ Year Member



A string is what is inside the variable?

 Variable = "Content of variable aka a string" 

    Is this correct? The string is the content.

mattglet

1:40 pm on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A string is what is inside the variable?

A string is one of the many datatypes that CAN be inside a variable.

Variable = "Content of variable aka a string"

Is this correct? The string is the content.

This is correct.

cmatcme

2:38 pm on Mar 12, 2005 (gmt 0)

10+ Year Member



Where else can they be?

mattglet

9:21 pm on Mar 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a good article:
[onlamp.com...]

Easy_Coder

2:04 am on Mar 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should also research Variant, Reference and Value types...

Those are going to take you under the hood of a string. Variant because that's what your dealing with in asp. Reference & Value because it's important to understand the difference between the two as it pertains to storage on the Stack and the Heap because that's truly where your variable values are going to be stored at.

cmatcme

9:02 am on Mar 13, 2005 (gmt 0)

10+ Year Member



Thanks everyone!