User Guide

416 Chapter 18: Code
Arguments
offset, {searchDirection}
The offset argument is a number that specifies the offset in the code for which the function
will return any errors.
The searchDirection argument, which is optional, is a string that specifies "empty",
"
forward" or "back". If specified, the function searches forward or back from the given
offset to the next characters with errors and returns them. If not specified, the function simply
checks for errors at the given offset.
Returns
An array of objects or the value null. Each object in the array has the following properties:
The message object is a string that contains the error message.
The floaterName object is a string that contains the name of the results window. You can pass
this value to the
showResults() or setFloaterVisibility() functions.
The floaterIndex object is an index of items in the floater results list.
The start object is the opening index of underlined code.
The end object is the closing index of underlined code.
Note: The returned floater indexes should not be stored because they can change frequently, such as
when documents are opened or closed.
Example
The following example calls getValidationErrorsForOffset() to check for any errors at the
offset of the current selection. If the function returns an error, the code calls the
alert() function
to display the error message to the user.
var offset = dw.getDocumentDOM().source.getSelection()[0];
var errors = dw.getDocumentDOM().source.getValidationErrorsForOffset(offset);
if ( errors && errors.length > 0 )
alert( errors[0].message );
dom.source.indentTextview()
Availability
Dreamweaver 4.
Description
Moves selected Code view text one tab stop to the right.
Arguments
None.
Returns
Nothing.
000_DW_API_Print.book Page 416 Wednesday, August 20, 2003 9:14 AM