C1Awk Reference > C1Awk Properties > Error Property |
Returns a code that identifies the last error trapped by the control.
val% = [form!]C1Awk.Error
This property is set by the control before the Error event is fired, and allows you to determine what type of error occurred.
The following errors may occur while parsing a file using the Action property:
Error Code |
Value |
Description |
aerCantOpen |
1 |
The file specified by the FileName property cannot be found. |
aerLineTooLong |
2 |
The file contains lines longer than 64k characters (Awk truncated the line). |
aerFieldTooLong |
3 |
Changing a field that would make the line longer than 64k characters. |
aerBadFieldGet |
4 |
Setting a field that does not exist, i.e., smaller than zero or greater than NF. |
aerBadFieldSet |
5 |
Getting a field that does not exist, i.e., smaller than zero or greater than NF. |
The following errors may occur while evaluating a numerical expression using the Val property or the Eval method:
Error Code |
Value |
Description |
aerSyntax |
6 |
Expression has bad syntax, as in 1+/ 2. |
aerBadToken |
7 |
The expression has undefined variables, as in foo+bar. |
aerBalance |
8 |
Expression has unbalanced brackets, as in 1+(2+3. |
aerDivBy0 |
9 |
Tried to divide a value by zero, as in 12/(5-5). |
aerDomain |
10 |
Argument is not in domain of function, as in Log(-1). |
aerSingularity |
11 |
Expression would result in a singularity. |
aerOverflow |
12 |
Expression has a value too big to represent, as in Exp(1000). |
aerPartialLoss |
13 |
Expression result has a partial loss of significant digits. |
aerTotalLoss |
14 |
Expression result has a total loss of significant digits. |
aerUnderflow |
15 |
Expression has a value too small to represent. |
AwkErrorSettings (Enumeration)