Errata

VB & VBA in a Nutshell: The Language

Errata for VB & VBA in a Nutshell: The Language

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 19, 24
Example Sub Main() procedure for starting a VB app.

The line "oForm.Show vbModal" works for a regular form, but not for an MDI
form, since MDI forms can't be shown modally.

Anonymous   
Printed Page 27
Date description

What is the precision of Date? The range is specified in days, but the default value
is specified in time, with a 1 second precision. Which day is default? The range
and default should match in precision.

Anonymous   
Printed Page 28
Integer description

The line "One bit represents the sign (either positive or negative)." should read,
"The number is represented as a 16 bit two-complement number. This incorporates the
sign in its range." The statement as it stands is inaccurate because it implies that
the bit string &h8000 is negative zero, not -32,768.

Anonymous   
Printed Page 28
in Chapter 3 - VBA Variables and Data Types

You have the Range of a long integer having a maximum of 2,147,486,647
It should read 2,147,483,647

Anonymous   
Printed Page 39
Before "Nothing keyword"

From your examples, "Empty" is also a keyword. There should be an "Empty keyword"
section between the "vbEmpty" section and the "Nothing keyword" section.

Anonymous   
Printed Page 39
"Nothing Keyword" section

For: Set objvar = Nothing
Read: Set objVar = Nothing

Anonymous   
Printed Page 41
Box ("ReDim Preserve''s Performance") 1st paragraph, 2nd sentence

"affect" should be changed to "effect"

Dave Roberts  Dec 24, 2010 
Printed Page 46
Beginning of second paragraph of "Variable Scope and Lifetime" section

"... module using the Private keyword ..." should read "... module using the Dim or
Private keywords ...".

Anonymous   
Printed Page 47
In the "Friend Scope" paragraph

This item now reads:

"The Friend keyword can only be used for variables and procedure
declarations within an object module..."

Alas, the Friend keyword is valid ONLY for procedures (or properties) and
NOT for variables...

Anonymous   
Printed Page 51, 541
These pages contradict each other. Page 51, penultimate paragraph

states:

... ByRef is much faster than ByVal.

Page 541, last paragraph states:

In general, ByRef arguments ... within class modules take longer to
perform [than ByVal arguments] ...

Anonymous   
Printed Page 52
"Optional Arguments" section. Add an example at the end

Public Sub Msg (Optional ByVal Message as Variant)
Debug.Print "Message = " &
Iif(IsMissing(Message),"<null>",Message)
End Sub

Anonymous   
Printed Page 53
Before Intrinsic Constants section

A section named "Literal Constants" needs to be added describing how to form literal
strings (Enclosed in "s and embedded "s are represented by "". means nothing.),
date literals (Enclosed in #s. Must look like a date -- but what exactly does THAT
mean?), hexadecimal constants (Preceded by &h and in upper or lower case). The on-
line documentation is rather mute about this. I picked up most of this from
examples. Other language definitions usually mention this quite explicitly. See
chap. 3 of JavaScript, The Definitive Guide, examples in chap. 2 of Programming Perl,
6.1.3.4 of the C language standard, etc.

Anonymous   
Printed Page 54
third paragraph, first line

For: COM interface
Read: COM (Component Object Model) interface

Anonymous   
Printed Page 85-86
Between lines 2 and 3 of example code

While the description of this code snippet suggests "you can seamlessly use Microsoft Word
to print output from your VB program without the user knowing that you have actually
used Microsoft Word," this is only true if you insert this line immediately after the
line "Set oWordSel = Nothing" and before the line "Set oWordActiveDoc = Nothing":

oWordActiveDoc.Close SaveChanges:=wdDoNotSaveChanges

Otherwise, if Word is already running, the document created by your code will appear as a
window which the user may activate and view, or, on shutdown, the user will be prompted to
save the document. Either case will destroy the "illusion" that you are trying to
achieve.

Anonymous   
99
middle of page

"On Error 0" should read "On Error GoTo 0"

Anonymous  Aug 17, 2010 
Printed Page 127
Fourth bulleted tip

Second line of the example reads:

Title = Array("Mr", "Mrs", "Miss", "Ms")

I think it should read

Titles = Array("Mr", "Mrs", "Miss", "Ms")

Anonymous   
Printed Page 129
"See Also" section at top of page

Add: IsArray Function

Anonymous   
Printed Page 129
In the "Return Value" section, explain the abbreviation DBC.

Anonymous   
Printed Page 132
Add a new entry


Assert Method
See Debug.Assert method.

Anonymous   
Printed Page 140
8th paragraph

The Gregorian calendar year of 1998 (which is based
on the birth of Christ) is roughly equivalent to the
Hijri year of 1418 (which is based on the birth of
Mohamed).

The Hijri calendar is not based on the birth of Mohamed. The year 0 in the
Hijri calendar is the year when Mohamed moved from Mecca to Medina.

Anonymous   
Printed Page 141
2nd paragraph (Ch. 7 > Calendar Property > Programming tips & gotchas)

This section should mention the limits of any Hijri calendar algorithm, and
specify (if possible) the coordinates (latitude and longitude) used for the
VB/VBA conversion. For more details, see:
http://www.cs.pitt.edu/~tawfig/convert/introduction.html.

Anonymous   
Printed Page 146
Add a new entry


Case Statement
See Select Case statement.

Anonymous   
Printed Page 157
last text paragraph

For: ... using the Choose function to handle the an option button selection ...
Read: ... using the Choose function to handle an option button selection ...

Anonymous   
Printed Page 158
"See Also" section

For: ... Switch Statement
Read: ... Switch Function

Anonymous   
Printed Page 163
"See Also" section

Add: Reset Statement

Anonymous   
Printed Page 168
Collection.Count is actually a method, not a property -- at least

that's what I see in the Object Browser. (Am I pedantic or what?)


Anonymous   
Printed Page 175
For the Command Function, add a new section

Add: See Also

Shell Function


Anonymous   
Printed Page 175
"Syntax" section

For: [Public|Private] Const constantname = constantvalue
Read: [Public|Private] Const constantname [As datatype] = constantvalue

Also, modify the rest of this entry to reflect the availability of the "As"
clause.


Anonymous   
Printed Page 178
"Description" section, add a final sentence

Add: CreateObject causes the object's Initialize event to be raised.


Anonymous   
Printed Page 182
"Return Value" section and "Description" section

For: ... current path.
Read: ... current directory path


Anonymous   
Printed Page 182
"Rules at a Glance" section, first bullet

For: ... returns the path for the current drive.
Read: ... returns the current directory path for the current drive.


Anonymous   
Printed Page 185
"See Also" section

Add: Error Statement


Anonymous   
Printed Page 194
"Programming Tips & Gotchas" section, add another bulleted tip

Add: Date and Date$ do not honour locale settings other than the USA locale.

Workaround 1: DateAdd("d",0,Now)
Workaround 2: Format(Now,"dddddd")


Anonymous   
Printed Page 225
The Dictionary.Add method

Takes a parameter called "item," does not require "item" to be String data type as
listed at the top of the page, but of course any data type -- as you correctly
state six lines later.

Anonymous   
Printed Page 227
"Programming Tips & Gotchas: section

For: ... or assign a new key to a nonexistent key ...
Read: ... or assign a new item to a nonexistent key ...


Anonymous   
Printed Page 236
"Description" section, add a second sentence

Add: Can be used to determine whether a disc object (file or folder/directory)
exists.


Anonymous   
Printed Page 237
"Rules at a Glance" section continued from the preceding page, second

full bulleted item on this page:
For: If attributes isn't specified, files matching pathname ...
Read: If attributes isn't specified, non-directory files matching pathname ...


Anonymous   
Printed Page 237
"Rules at a Glance" section continued from the preceding page, add a

further bulleted item:
Add: Use CurDir to get the current directory's path.


Anonymous   
Printed Page 242
example following third bulleted item

For: If lngCtr / 1000 = Int(lngctr / 1000) Then
Read: If lngCtr Mod 1000 = 0 Then


Anonymous   
Printed Page 245
Add a new entry


Empty Keyword

Description

A data subtype automatically assigned to Variant variables
before they are assigned a value.

Anonymous   
Printed Page 245
"Syntax" section, add a further entry to the list

add: End


Anonymous   
Printed Page 245
"Description" section

For: Ends a procedure or a block of code.
Read: Terminates program execution, or ends a procedure or a block of code.


Anonymous   
Printed Page 246
"See Also" section

Add: Stop Statement


Anonymous   
Printed Page 250
"Example" section

For: LineInput #iFile, sDataLine
Read: Line Input #iFile, sDataLine


Anonymous   
Printed Page 266
Add a new entry


Error Keyword

Description

A data subtype of a Variant variable used to store an
error number


Anonymous   
Printed Page 266
"Syntax" section of Event Statement

For: Public Event eventName [(arglist)]
Read: [Public] Event eventName [(arglist)]


Anonymous   
Printed Page 269
Add a new entry


False Keyword

Named Arguments
No

Syntax
False

Description
The False keyword has a value of 0.

Programming Tips & Gotchas
The True keyword has a value of -1.


Anonymous   
Printed Page 272
"Named Parameters" section

For: Named Parameters
Read: Named Arguments


Anonymous   
Printed Page 278
"See Also" section

Add: GetAttr Function


Anonymous   
Printed Page 282
"Methods" section

For: GetSpecialFolderd
Read: GetSpecialFolder


Anonymous   
Printed Page 288
5th item in Rules at a Glance

The default value of the Overwrite argument to the FileSystemObject.CreateTextFile
method is true, not false.

Anonymous   
Printed Page 294
5th line from the top

If ofs.fileExists("\NTSERV1d$TestPath") Then
should be:
If ofs.folderExists("\NTSERV1d$TestPath") Then

Anonymous   
Printed Page 299
"Programming Tips & Gotchas" section, first bulleted item

For: ... such as coping or moving files ...
Read: ... such as copying or moving files ...


Anonymous   
Printed Page 325
"Syntax" section, "format" subsection

Add: Data Type: String


Anonymous   
Printed Page 327
Examples for 'Medium Time' and 'Short time';

The first parameter should be a time, not a date

Anonymous   
Printed Page 333
"Programming Tips & Gotchas" section, first bulleted item, last

sentence:
For: sMyString = Format(rsMyRecordSet!myValue)
Read: sMyString = "" & rsMyRecordSet!myValue

(But this now removes the purpose of this bulleted item which was to
illustrate Format().)


Anonymous   
Printed Page 335
"Rules at a Glance" section, second bulleted item

For: The Tristate constant values are TristateTrue, TristateFalse, and
TristateUseDefault
Read: The Tristate constant values are vbTrue, vbFalse and vbUseDefault [See
page 604]


Anonymous   
Printed Page 335
"Programming Tips & Gotchas" section, add an example

Add: Example
FormatCurrency("18062.1",2,,vbTrue)
returns $18,062.10


Anonymous   
Printed Page 337
"Description" section

Add: If you have been using FreeFile to supply file numbers, checking its
value will reveal how many files have been opened.


Anonymous   
Printed Page 338
Syntax of Function statement

| Friend]

should read:

| [Friend]

Anonymous   
Printed Page 351
Rules at a Glance section, sixth bulleted item

For:

Dim hFile As long
hFile = FreeFile()
Open sFileName For Random as #hFile
Do While Not EOF(1)
Get #1,,myVar
Loop
Close #hFile

Read:

Dim hFile As Long
Dim myVar as String
hFile = FreeFile()
Open sFileName For Binary as #hFile
myVar = Space$(LOF(#hFile)) ' Make room for file
Get #hFile,,myVar
Close #hFile


Anonymous   
Printed Page 355
Add a "See Also" section

Add: See Also
FileAttr Function, SetAttr Function


Anonymous   
Printed Page 361
"Programming Tips & Gotchas" section, add an example

Add: Example
GetSetting("myApp", "Prefs", "Velocity")


Anonymous   
Printed Page 379
"Syntax" section, "xpos" and "ypos" subsections

For: The distance from the ...
Read: The distance in twips from the ...


Anonymous   
Printed Page 384
"Syntax" section, "start" subsection

Add: If start > Len(sourcestring), InstrRev returns 0.


Anonymous   
Printed Page 385
"Programming Tips & Gotchas" section:

For: The usefulness of a function ... isn't immediately apparent.
Read: InstrRev is useful for extracting the rightmost substring of a string,
for example, extracting a filename from a pathname:

myFile = Mid$(myPath,InstrRev(myPath,"")+1)


Anonymous   
Printed Page 395
"Programming Tips & Gotchas" section, add another bulleted entry

Add: If expression is "" then IsNumeric returns false.


Anonymous   
Printed Page 397
Add a "See Also" section for the Join Function

Add: See Also
Split Function


Anonymous   
Printed Page 397
"Rules at a Glance" section for Kill Statement, last bulleted item

For: If the file is open or is set to read-only, an error is generated.
Read: If the file is open or is set to read-only, an error is generated. To
delete a read-only file, either use SetAttr statement to first clear the
read-only bit, or use the FileSystemObject.DeleteFile method with the Force
flag set.


Anonymous   
Printed Page 399
"Programming Tips & Gotchas" section, delete the second bulleted entry

[see page 126]


Anonymous   
Printed Page 407
first paragraph

For: The new controls inherit all the properties of the original control,
including it's size and position
Read: The new controls inherit most of the properties of the original control,
including size and position. The properties not inherited are Index, TabIndex,
and Visible (see below).


Anonymous   
Printed Page 411-412
"Syntax" section, "resID" subsection

Add: Resource ID 1 is reserved for an application's icon.


Anonymous   
Printed Page 415
"See Also" section

Add: Seek Function


Anonymous   
Printed Page 415
"Syntax" section, "filenumber" subsection of Lock Statement

For: Any valid file number.
Read: Any valid file number. The file must be open shared.


Anonymous   
Printed Page 416
"Syntax" section, "recordrange" subsection

For: A range of records.
Read: A range of records; the default is the entire file.


Anonymous   
Printed Page 426
"Return Value" section

For: A Double representing the modified internal rate of return.
Read: A Double representing the modified internal rate of return on a cash
flow.


Anonymous   
Printed Page 427
"Rules at a Glance" section, second bulleted item

For: ... or it's UNC name.
Read: ... or it's UNC (Universal Naming Code) name.


Anonymous   
Printed Page 430
"Rules at a Glance" section, fourth bulleted item

For: ... a Help button is automatically placed on the MsgBox dialog ...
Read: ... you must include vbMsgBoxHelpButton in the buttons argument ...


Anonymous   
Printed Page 431
"Button Display Constants" table, add an extra line

Add: vbMsgBoxHelpButton 16384 Help


Anonymous   
Printed Page 435
Add a new entry


Nothing Keyword

Description

Used with object variables to determine whether a variable
has a valid object reference, e.g., If Not objVar Is Nothing
Then or to destroy a valid object reference (thus releasing
resources), e.g., Set objVar = Nothing.


Anonymous   
Printed Page 437
"Return Value" section

For: A Double indicating the number of payments.
Read: A Double indicating the number of payments (periods) in an annuity.


Anonymous   
Printed Page 439
Add a new entry


Null Keyword

Description

A data subtype used to indicate a Variant variable doesn't
contain any valid data.


Anonymous   
Printed Page 442
"Syntax" section, "access" subsection

For: Specifies the allowable operations by the current process.
Read: Specifies the allowable file operations by the current process:

Read or Write or Read Write.


Anonymous   
Printed Page 443
"Rules at a Glance" section, first bulleted item

For: ... or a UNC path.
Read: ... or a UNC (Universal Naming Code) path.


Anonymous   
Printed Page 444
"See Also" section

Add: FileAttr Function


Anonymous   
Printed Page 445
"See Also" section of Option Base Statement

Add: LBound Function


Anonymous   
Printed Page 445
For the Option Compare Statement, add a new section

Add: See Also
StrComp Function


Anonymous   
Printed Page 447
Add a new entry


Partition Function (VB6)

Named Arguments
Yes

Syntax

Partition(number, start, stop, interval)
Number
Use: Required
Data Type: Long ?
Number that you want to evaluate against the ranges.


start
Use : Required
Data Type: Long ?
Start of the first range.
stop
Use: Required
Data Type: Long ?
End of the last range.
interval

Use: Required

Data Type: Long ?
Width of each range.


Return Value

A Variant of subtype String indicating where number
occurs within a series of ranges.


Description

The Partition function identifies the particular range
(within a series of ranges) in which the number argument
falls. The start and stop arguments specify the overall
range of numbers, which is split up into smaller ranges
as specified by the interval argument. The Partition function
returns a string representation of the smaller range in which
the number can be found, such as " 1: 10" for a number that
falls in the range of 1 to 10.


Rules at a Glance

* 0 <= start < end.

* 0<interval.

* Any non-integer argument is rounded to the nearest
integer (if the decimal portion is .5 it is rounded to the nearest
even integer).

* If any argument is Null, Partition returns a Null.

* If any argument is invalid, run-time error 5 is
raised (Invalid procedure call or argument).


Example

Consider the following frequency histogram generated by the
Phoenix system, a planning system that fights simulated forest
fires. Source: http://eksl-www.cs.umass.edu/eis/pages/techniques/
histogram-const-desc.html

The code to find the range (or "bin") for an area burned of
47 acres is:

Partition (47,0,100,10)
The result is:
" 40: 49" [ignore the double quotes, but notice the spaces]

Note that:
Partition (47,0,90,10)
Returns:
"40:49" rather than " 40: 49".

Programming Tips & Gotchas

* Partition returns a range with enough leading
spaces so that there are the same number of characters to
the left and right of the colon as there are characters in
stop, plus one. This ensures that if you use Partition with
other numbers, the resulting text will be handled properly
during any subsequent sort operation.

* If interval is 1, the range returned is
number:number, regardless of the start and stop arguments.
For example, if interval is 1, number is 100 and stop is 1000,
Partition returns " 100: 100".

* The following table shows how the ranges are
determined using three sets of start, stop, and interval parts.
The First Range and Last Range columns show what Partition
returns. The ranges are represented by lowervalue:uppervalue,
where the low end (lowervalue) of the range is separated from
the high end (uppervalue) of the range with a colon (:).

Returned results:-


start

stop

interval
number Before First Range
number Within First Range
number Within Last Range
number After Last Range

0
99
5
" :-1"
" 0: 4"
" 95: 99"
" 100: "

20
199
10
" : 19"
" 20: 29"
" 190: 199"
" 200: "

100
1010
20
" : 99"
" 100: 119"
" 1000: 1010"
" 1011: "

In the table above, the last line shows the result when start and stop define
a set of numbers that can't be evenly divided by interval. The last range
extends to stop (11 numbers) even though interval is 20.

Anonymous   
Printed Page 448
"Syntax" section, "due" subsection

For: 0 indicates that payments are due at the beginning of the payment period;
Read: 1 indicates that payments are due at the beginning of the payment period;

For: 1 indicates that payments are due at the end of the period.
Read: 0 indicates that payments are due at the end of the period.


Anonymous   
Printed Page 448
"Syntax" section, "Return Value" subsection

For: A Double representing the monthly payment.
Read: A Double representing the periodic payment for an annuity.


Anonymous   
Printed Page 449
"Syntax" section, "due" subsection

Add: The default is 0.


Anonymous   
Printed Page 449
"Syntax" section, "Return Value" subsection

For: A Double representing the principal paid in a given payment.
Read: A Double representing the principal paid in a given payment of an
annuity.


Anonymous   
Printed Page 450
Add a new entry


Print Method
See Debug.Print method and Printer.Print method.


Anonymous   
Printed Page 451
"Syntax" section, "charpos" subsection

Add: Either ; or Tab(n) or Tab .


Anonymous   
Printed Page 452
"See Also" section

Add: Put Statement


Anonymous   
Printed Page 458
"Printer Object Methods" section, add a new subsection

Add: Outputs a closed circle, elipse or pie slice (arc with radius lines drawn
at both ends).
Syntax: Circle oPrinter.Circle [Step] (x,y), radius, [color, start, end,
aspect]


Anonymous   
Printed Page 458
"Printer Object Methods" section, "Line" subsection

For: Syntax: oPrinter.Line [Step] (x1,1) [Step] (x2,y2) [color], [B][F]
Read: Syntax: oPrinter.Line [Step] (x1,y1) [-] [Step] (x2,y2) [color], [B][F]


Anonymous   
Printed Page 458
"Printer Object Methods" section, add a new subsection

Add: Outputs the evaluated output list
Syntax: oPrinter.Print [outputlist]
Example: oPrinter.Print "Printout finished at " ; Time()


Anonymous   
Printed Page 459
"Printer Object Methods" section, "TextHeight" subsection and "TextWidth"

subsection:
For: ... in pixels ...
Read: ... in scale units ...


Anonymous   
Printed Page 459
"Printers Collection" section, second bulleted item at the start of the

sample code:
Add: Dim oPrinter as Printer


Anonymous   
Printed Page 459
Subsection "TextHeight"

Returns the *height* (not the width) as is shown.

Anonymous   
Printed Page 477
"Programming Tips & Gotchas" section, second bulleted item

For: ... allow the use of WithEvents all object modules.
Read: ... allow the use of WithEvents in all object modules.


Anonymous   
Printed Page 479
"See Also" section

Add: Type Statement, Print # Statement, Write # Statement


Anonymous   
Printed Page 484
"Programming Tips & Gotchas" section

For: ... negative number as an argument immediately prior to using Randomize
with any numeric argument.
Read: ... negative number as an argument.


Anonymous   
Printed Page 485
"Return Value" section

For: A Double representing the interest rate per period.
Read: A Double representing the annuity's interest rate per period.


Anonymous   
Printed Page 500
"Programming Tips & Gotchas" - 1st bullet

Round with a numdecimalplaces set to 2 is NOT equivalent to Format (expression,
"#.##")!!!

THIS IS VERY IMPORTANT IN FINANCIAL APPLICATIONS!!!

Round() and Format() round numbers differently when the digit to the right of
numdecimalplaces is a 5. Format will always round this number up and Round() will
round up or down depending on whether the numdecimalplaces digit is even or odd!!!!!!

Ex. [Even digit - NOT EQUIVALENT!!]
Format(23.685,"#.##") = 23.69
Round(23.685,2) = 23.68
-----------------------------------
[Odd digit - Equivalent]
Format(23.675,"#.##") = 23.68
Round(23.675,2) = 23.68

In financial apps I use CCur(Format(myNumber,"#.##")) which is clumsy but correct.

Anonymous   
Printed Page 500
"Rules at a Glance" section, first bulleted item

For: ... between 0 and 16.
Read: ... between 0 and 22.


Anonymous   
Printed Page 500
"Rules at a Glance" section, second bulleted item

For: ... numdecimalplaces is 5 or greater ...
Read: ... numdecimalplaces is 6 or greater ...

For: ... incremented by 1; otherwise ...
Read: ... incremented by 1; if 5, the number is adjusted to be the nearest
even integer; otherwise ...


Anonymous   
Printed Page 500
"Programming Tips & Gotchas" section, first bulleted item

For: ... Format(expression, #.##)
Read: ... Format(expression, #.##) or Format(expression, "Fixed")


Anonymous   
Printed Page 502
Add an example to the "SaveSetting Statement"

Add: Example: SaveSetting "myApp", "Prefs", "Velocity", 500


Anonymous   
Printed Page 505
"See Also" section of the "Seek Function"

Add: Loc Function


Anonymous   
Printed Page 506
In the table just above the "Description" section, add a further example

Add: "good", "bad", "ugly"


Anonymous   
Printed Page 508
"See Also" section

Add: Choose Function, Switch Function


Anonymous   
Printed Page 517
"See Also" section

Add: FileAttr Function


Anonymous   
Printed Page 521
"Return Value" section

For: A Double representing depreciation per period.
Read: A Double representing depreciation per period of an asset.


Anonymous   
Printed Page 527
Add an extra entry to the table

Add: Boolean False


Anonymous   
Printed Page 530
"stdDataFormats Events" section

For: stdDataFormats Events
Read: stdDataFormat Events


Anonymous   
Printed Page 532
"Description" section

For: Halts program execution.
Read: Pauses program execution.


Anonymous   
Printed Page 534
"Rules at a Glance" section, table within first bulleted item

For: vbTextCompare 1 Textual
Read: vbTextCompare 1 Textual (case insensitive)


Anonymous   
Printed Page 544
Second para beginning "Fixed-length strings.."

Paul states that "fixed-length strings cannot be passed as paramters to a
sub pprocedure". He says that if you try to pass a fixed-length string to a
sub (or function) BYREF, the string will be passed as if BYVAL and the
original will not be affected. Not so. In his example, where he passes
"Hello" and tries to add " World" what actually happens is that the
subroutine does add World....to the end of the fixed-length string, i.e. at
position 21. When the calling routine displays the result, VB treats the
string as fixed 20 again and just displays "Hello". But it IS the string
modified by the procedure.

To prove this, just change the subroutine's action from
strFX = strFX & " World"
to
strFX = trim$(strFX) & " World".

The calling routine will display "Hello World". The Byref action in fact
functions normally.

Anonymous   
Printed Page 545
"See Also" section

Add: Choose Function


Anonymous   
Printed Page 546
"Return Value" section

For: A Double representing depreciation per period.
Read: A Double representing an asset's depreciation per period.


Anonymous   
Printed Page 547
Add an example

Add: Printer.Print "Hello"; Tab(20); "World"


Anonymous   
Printed Page 550
At the extreme top left of the page

For: TextStream Object
Read: TextStream Object (VB6)


Anonymous   
Printed Page 551-555
At the extreme top left/right of each page

For: TextStream.??? Method
Read: TextStream.??? Method (VB6)


Anonymous   
Printed Page 557
Add an example

Add:

Public Sub Sleep(secs as single)
' Pause for the specified number of seconds
' This will fail if midnight is spanned
Dim EndTime As Single
EndTime = Timer + secs
Do While EndTime > Timer: DoEvents: Loop
End Sub


Anonymous   
Printed Page 557
"Programming Tips & Gotchas" section, add an extra bulleted item

Add: Note that the hardware real-time clock on an Intel PC has a granularity
of only 1/18th of a second. Times and time intervals cannot be measured more
accurately than the hardware permits.


Anonymous   
Printed Page 559
Add a new entry


True Keyword

Named Arguments
No

Syntax
True

Description
The True keyword has a value of -1.

Programming Tips & Gotchas
The False keyword has a value of 0.

Anonymous   
Printed Page 563
"See Also" section

Add: Get Statement, Put Statement


Anonymous   
Printed Page 567
"Syntax" section, "filenumber" subsection of Unlock Statement

For: Any valid file number.
Read: Any valid file number. The file must be open shared.


Anonymous   
Printed Page 571
"Rules at a Glance" section, add a further bulleted item

Add: If firstdayofweek is omitted, it defaults to vbSunday


Anonymous   
Printed Page 575
"Rules at a Glance" section of "Width Statement", first bulleted item

For: width defines the number of characters ...
Read: width defines the maximum number of characters ...


Anonymous   
Printed Page 579
"See Also" section of "Write # Statement"

Add: Put Statement


Anonymous   
Printed Page 611
line just above "Operator Precedence" section

For: 10111100 = 00001111 Imp 10110011
Read: 10111100 = 00001111 Xor 10110011


INDEX:

Anonymous   
Printed Page 624
Add an extra entry to the index

Add: Global keyword, 176


Anonymous   
Printed Page 627
Amend the index entry "object models"

For: File system object model, 275-276
Read: File system object model, 275-276, 550-555


Anonymous   
Printed Page 631
Add an extra entry to the index

Add: TypeOf keyword, 368

Anonymous