Both Visual Basic for Applications and JavaScript permit variables to have the string datatype. While conversion from strings to other data types is possible (both VBA and JavaScript can be convinced to interpret a string of digits as a number, for example), there are also operations that can be performed directly on strings. The only such operation widely implemented is string concatenation — appending the contents of one string to the contents of another string.
In JavaScript, the string concatenation operator is +. In VBA, the string concatenation operator is &. Thus, for example, the JavaScript statement:
var a = "This is the life" + " of Reily."
is equivalent to the statement:
var a = "This is the life of Reily."
Providing a string concatenation operator for the calculator is impossible, as there are no string variables or expressions in the calculator. (The calculator does support what look like string constants, but these are in fact commands to echo the characters onto the display.)
[ Previous page | Top of page | Next page ]
Copyright © 2002 Brian Hetrick
Page last updated 13 January 2002.
Tutorial
Building Blocks I
Expressions
String
Control Flow II
Basic I/O
Algorithms
A First Program
Answers
Modularization
Data Structures I
Recursion
Program Attributes
Building Blocks II
Algorithm Analysis
Structuring
Data Structures II
Abstract Types
Objects
Problem Analysis
Reference Card
![]()