Материал из База Знаний Фирмы Интеграл
Перейти к: навигация, поиск
Особенности
При открытии программ по расчёту выбросов появляется сообщение об ошибке вида
Ошибка "Record is out of range"
Решение
- Открыть каталог данных программы (можно узнать в настройках, по умолчанию: «C:Program FilesIntegralкаталог программыdata» или «C:INTEGRAL.LTDкаталог программыdata»)
- Удалить файлы с расширением «.CDX»
Источник — «http://wiki.integral.ru/index.php?title=Ошибка_%22Record_is_out_of_range%22&oldid=3710»
Категория:
- Ошибки
- Remove From My Forums
-
Question
-
I’m new to VFP and am trying to fix a problem with a system I didn’t build. Here’s the sequence of events. User enters in an item number and when they tab out of the field, the lookup occurs and returns data to the other text boxes. But this sequence of errors happens instead of data being returned.Error 5. «Record is out of range.» I click Yes.
Continue executing program? I click OK.
Column heading «PO_NAME_NUM», error 5, Record is out of range. I click OK. I can enter info on this screen but if I save or exit the screen I get:
PO_NAME_NUM Error 114. «Index does not match the table. Delete the index file and re-create the index.» I click OK.
PO_NAME_NUM Error 1589. «Table or row buffering requires that SET MULTILOCKS is set to ON». I click OK.From my reading, I have done a REINDEX on the table containing «PO_NAME_NUM» and it didn’t work. I also deleted the index file and recreated it from scratch by typing in the indexes in VFP and then doing REINDEX from the command window, but still get the errors. Can anyone point me in the right direction please? Please remember I’m new to FoxPro and I have already Google bombed the errors…Thanks in advance!
Answers
-
It appears that my table lost its indexes even though I physically recreated them. To fix, I had to make a copy of the .dbf as to not loose any data…then delete the table and add it back in from a backup copy called fish that existed prior to the indexes getting hosed. Did a USE table_name. Then did a DELETE ALL on the old table that was brought in to clear out any info. Then PACK then APPEND FROM location of the backup of the table that had all the info in it (fish). BROWSE to see if the data was there CLOSE ALL then went in with MODIFY PROJECT application and checked to see if the indexes were there…they were. It fixed it.
Thanks for all who read the post.
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS
Contact US
Thanks. We have received your request and will respond promptly.
Log In
Come Join Us!
Are you a
Computer / IT professional?
Join Tek-Tips Forums!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts - Keyword Search
- One-Click Access To Your
Favorite Forums - Automated Signatures
On Your Posts - Best Of All, It’s Free!
*Tek-Tips’s functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Posting Guidelines
Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Students Click Here
Record is out of range ErrorRecord is out of range Error(OP) 8 Nov 01 12:43 I am getting a Record is out of Range error when I select a workspace. If I suspend the program and then resume everything runs normally. Does anyone have any ideas as to what I can do to get rid of this error??? Red Flag SubmittedThank you for helping keep Tek-Tips Forums free from inappropriate posts. |
Join Tek-Tips® Today!
Join your peers on the Internet’s largest technical computer professional community.
It’s easy to join and it’s free.
Here’s Why Members Love Tek-Tips Forums:
Talk To Other Members
- Notification Of Responses To Questions
- Favorite Forums One Click Access
- Keyword Search Of All Posts, And More…
Register now while it’s still free!
Already a member? Close this window and log in.
Join Us Close
title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | |||
---|---|---|---|---|---|---|---|---|---|---|---|
Visual FoxPro ODBC Driver Native Error Messages |
Visual FoxPro ODBC Driver Native Error Messages |
David-Engel |
v-davidengel |
01/19/2017 |
sql |
connectivity |
conceptual |
|
Visual FoxPro ODBC Driver Native Error Messages
The following tables list error messages native to the Visual FoxPro ODBC Driver.
001
Error code | Error message |
---|---|
1 | Feature is not available. |
2 | Input/output operation failure. |
3 | Free handle is not found. |
5 | Use of unallocated handle. |
99 | Procedure canceled. |
100
Error code | Error message |
---|---|
100 | Too many files open. |
101 | Cannot open file. |
102 | Cannot create file. |
105 | Error writing to file. |
107 | Invalid key length. |
109 | Record is out of range. |
110 | Record is not in index. |
111 | Invalid file descriptor. |
113 | File is not open. |
114 | Not enough disk space for value. |
115 | Invalid operation for the cursor. |
118 | Index file does not match table. |
119 | No table is open. |
120 | File does not exist. |
121 | File already exists. |
122 | Table has no index order set. |
123 | Not a table. |
125 | Index expression exceeds maximum length. |
127 | You must use a logical expression with a FOR or WHILE clause. |
128 | Not a numeric expression. |
129 | Variable is not found. |
132 | File is in use. |
133 | Index does not match the table. Delete the index file and re-create the index. |
135 | End of file encountered. |
136 | Beginning of file encountered. |
137 | Alias is not found. |
139 | You must use a logical expression with FILTER. |
142 | Cyclic relation. |
143 | No fields were found to copy. |
144 | The LOCATE command must be issued before the CONTINUE command. |
145 | Must be a character or numeric key field. |
146 | Cannot write to a read-only file. |
147 | Target table is already engaged in a relation. |
148 | Expression has been re-entered while the filter is executing. |
149 | Not enough memory for buffer. |
150 | Not enough memory for file map. |
155 | Invalid buffdirty call. |
156 | Duplicate field names. |
158 | No fields found to process. |
159 | Numeric overflow. Data was lost. |
162 | Procedure ‘value‘ is not found. |
165 | value is not related to the current work area. |
170 | Variable ‘value‘ is not found. |
171 | Cannot open file value. |
173 | File ‘value‘ does not exist. |
174 | ‘value‘ is not a memory variable. |
175 | ‘value‘ is not a file variable. |
176 | ‘value‘ is not an array. |
177 | Alias ‘value‘ is not found. |
180 | File was not placed in memory using the LOAD command. |
182 | There is not enough memory to complete this operation. |
200
Error code | Error message |
---|---|
200 | Syntax error. |
201 | Too many names used. |
202 | Program is too large. |
203 | Too many memory variables. |
205 | Nesting error. |
206 | Recursive macro definition. |
209 | Line is too long. |
210 | Allowed DO nesting level exceeded. |
211 | An IF | ELSE | ENDIF statement is missing. |
212 | Structure nesting is too deep. |
213 | There is a missing keyword in the FOR…ENDFOR or DO CASE…ENDCASE command structure. |
219 | Command contains unrecognized phrase/keyword. |
221 | Command is missing required clause. |
222 | Unrecognized command verb. |
224 | Invalid subscript reference. |
227 | Missing expression. |
228 | Table number is invalid. |
229 | Too few arguments. |
230 | Too many arguments. |
233 | Statement is not allowed in interactive mode. |
234 | Subscript is outside defined range. |
236 | Suspend program before using RESUME. |
238 | No PARAMETER statement is found. |
239 | Must specify additional parameters. |
240 | Not a character expression. |
250 | Too many PROCEDURE commands are in effect. |
252 | Compiled code for this line is too long. |
257 | Key string is too long. |
291 | Expression used with ASIN() is out of range. |
292 | Cannot use 0 or negative as the argument for LOG10(). |
293 | Expression used with ACOS() is out of range. |
294 | FOXUSER.DBF file is invalid. |
295 | Invalid path or file name. |
296 | Error reading the resource. |
297 | Command is allowed only in interactive mode. |
300
Error code | Error message |
---|---|
301 | Operator/operand type mismatch. |
302 | Data type mismatch. |
305 | Expression evaluated to an illegal value. |
307 | Cannot divide by 0. |
308 | Insufficient stack space. |
337 | Cannot nest the PRINTJOB command. |
400
Error code | Error message |
---|---|
406 | Printer is not ready. |
407 | Invalid argument used with the SET function. |
410 | Unable to create temporary work files. |
423 | Error creating the OLE object. |
424 | Error copying the OLE object to the Clipboard. |
462 | value internal consistency error. |
465 | SQL pass-through internal consistency error. |
466 | Connection handle is invalid. |
467 | Property is invalid for local cursors. |
468 | Property is invalid for table cursors. |
469 | Property value is out of bounds. |
470 | Incorrect property name. |
471 | Incorrect column format. |
473 | Environment-level property is invalid. |
474 | Invalid call issued while executing a SQLEXEC() sequence. |
479 | Invalid update column name value. |
489 | General fields cannot be used in the WHERE condition of an update statement. Change the WhereType property of the view. |
491 | No update tables are specified. Use the Tables property of the cursor. |
492 | No key columns are specified for the update table value. Use the KeyFieldList property of the cursor. |
493 | SQL parameter is missing. |
494 | View definition has been changed. |
495 | Warning: The key defined by the KeyField property for table value is not unique. |
498 | SQL SELECT statement is invalid. |
499 | SQL parameter value is invalid. |
500
Error code | Error message |
---|---|
502 | Cannot write to the record because it is in use. |
503 | File cannot be locked. |
508 | Error initializing OLE. |
520 | No database is open or set as the current database. |
522 | Connectivity internal consistency error. |
523 | Execution was canceled by the user. |
525 | Function is not supported on remote tables. |
526 | Connectivity error: value. |
527 | Cannot load ODBC library, ODBC32.DLL. |
528 | ODBC entry point missing, value. |
530 | Fetching canceled; remote table is closed. |
532 | Type conversion is not supported. |
533 | This property is read-only. |
536 | Function is not supported on native tables. |
538 | A stored procedure is executing. |
540 | Session number is invalid. |
541 | Connection value is busy. |
542 | Base table fields have been changed and no longer match view fields. View field properties cannot be set. |
543 | Type conversion required by the DataType property for field ‘value‘ is invalid. |
544 | DataType property for field ‘value‘ is invalid. |
545 | Table buffer for alias value contains uncommitted changes. |
546 | Cannot close table during execution of table-bound expression. |
547 | Cannot insert an empty row from a view into its base table(s). |
548 | Table value has one or more non-structural indexes open. Please close them and retry the Begin Transaction. |
549 | Data session #value cannot be released with open transaction(s). |
550 | .DBC internal consistency error. |
557 | The database must be opened exclusively. |
559 | Property is not found. |
560 | Property value is invalid. |
561 | Database is invalid. Please validate. |
562 | Cannot find object value in the database. |
563 | Cannot find view value in the current database. |
566 | Cannot issue the PACK command on a database while its tables are in use. |
567 | Primary key property is invalid; please validate database. |
570 | Database is read-only. |
571 | The name value is already used for another |
575 | Object name is invalid. |
577 | Table value is referenced in a relation. |
578 | Invalid database table name. |
579 | Command cannot be issued on a table with cursors in table buffering mode. |
580 | Feature is not supported for non-.DBC tables. |
581 | Field value does not accept null value. |
583 | Record validation rule is violated. |
585 | Update conflict. Use TABLEUPDATE() with the lForce parameter to commit the update or TABLEREVERT() to roll back the update. |
586 | Function requires row or table buffering mode. |
587 | Illegal nested OLDVAL() or CURVAL(). |
589 | Table or row buffering requires that SET MULTILOCKS is set to ON. |
590 | BEGIN TRANSACTION command failed. Nesting level is too deep. |
591 | END TRANSACTION command cannot be issued without a corresponding BEGIN TRANSACTION command. |
592 | ROLLBACK command cannot be issued without a corresponding BEGIN TRANSACTION command. |
593 | Command cannot be issued within a transaction. |
594 | Illegal to attempt a file lock in a transaction after taking prior record locks. |
596 | Table buffering is not enabled. |
597 | Views require either DB_BUFOPTROW or DB_BUFOPTTABLE. |
598 | Rule and trigger code must balance transaction usage. |
599 | Data session #value was forced to ROLLBACK all transactions to avoid deadlock. |
600
Error code | Error message |
---|---|
601 | Alias name is already in use. |
602 | Operation is invalid for a Memo, General, or Picture field. |
612 | No such menu or menu item is defined. |
618 | Menu has not been defined with DEFINE MENU. |
624 | Menu title has not been defined with DEFINE PAD. |
625 | Menu has not been defined with DEFINE POPUP. |
631 | Array dimensions are invalid. |
637 | File must be opened exclusively to convert the Memo file. |
638 | Field must be a Memo field. |
649 | No previous PRINTJOB command to correspond to this command. |
651 | CANCEL or SUSPEND is not allowed. |
659 | The table has memo fields that cannot be converted while open read-only. |
683 | Index tag is not found. |
700
Error code | Error message |
---|---|
700 | Record is in use by another user. |
701 | File must be opened exclusively. |
702 | File is in use by another user. |
703 | Record is not locked. |
705 | File access is denied. |
706 | Cannot sort .IDX files in descending order. |
707 | Structural .CDX file is not found. |
708 | File is open in another work area. |
712 | Field name is a duplicate or invalid. |
714 | Window ‘value‘ has not been defined. |
718 | File is read-only. |
722 | Preprocessor expression is invalid. |
734 | Property value is not found. |
737 | value is a method, event, or object. |
738 | Property value is not a method or event. |
740 | value is a read-only property. |
748 | This file is incompatible with the current version of Visual FoxPro. |
750 | File was created in a later version of Visual FoxPro than the current version. |
763 | Property value already exists. |
773 | Database object type is invalid. |
784 | This object is derived from a base class and does not have a parent class. |
800
Error code | Error message |
---|---|
802 | SQL: Cannot locate table. |
872 | Too many columns. |
879 | No primary key. |
884 | Uniqueness of index value is violated. |
885 | Only structural tags can be defined as candidate. |
886 | Index does not accept NULL. |
887 | Illegal recursion in rule evaluation. |
888 | Tag name is too long. |
900
Error code | Error message |
---|---|
901 | Function argument value, type, or count is invalid. |
902 | Expression evaluator failed. |
903 | String is too long to fit. |
904 | ** or ^ domain error. |
905 | LOG(): Zero or negative used as argument. |
906 | SQRT() argument cannot be negative. |
912 | Operation is invalid for a General field. |
914 | Code page number is invalid. |
915 | Collating sequence ‘value‘ is not found. |
918 | File name is too long. |
922 | Volume does not exist. |
923 | Object value is not found. |
924 | value is not an object. |
925 | Unknown member value. |
928 | Statement is only valid within a class definition. |
929 | value can only be used within a method. |
930 | Cannot redefine value. |
931 | Statement is not in a procedure. |
934 | Statement is only valid within a method. |
935 | The current object does not inherit from class value. |
937 | Procedure file ‘value‘ is not found. |
938 | Object is not contained in a value. |
939 | WITH/ENDWITH mismatch. |
940 | Expression is not valid outside of WITH/ENDWITH. |
941 | Error code is invalid. |
942 | Objects cannot be assigned to arrays. |
943 | Member value does not evaluate to an object. |
945 | The current object has been released. |
947 | Expression is too complex. |
951 | Cannot clear the object in use. |
955 | WIN.INI/registry is corrupted. |
957 | Error accessing printer spooler. |
959 | Invalid coordinates. |
960 | Illegal redefinition of variable value. |
971 | Cannot compile until the current COMPILE command has completed. |
972 | Array value is in use. |
974 | Arrays cannot be assigned to array elements. |
976 | Cannot resolve backlink. |
988 | Currency value is out of range. |
990 | Cancel. |
999 | Function is not implemented. |
« Назад
Команды
GO [RECORD] nRecordNumber [IN nWorkArea | cTableAlias]
или
GO TOP | BOTTOM [IN nWorkArea | cTableAlias]
или
GOTO [RECORD] nRecordNumber [IN nWorkArea | cTableAlias]
или
GOTO TOP | BOTTOM [IN nWorkArea | cTableAlias]
перемещают файловый указатель таблицы (текущей или указанной параметром nWorkArea | cTableAlias) на запись, имеющую заданный номер, или на начало или конец таблицы.
RECORD nRecordNumber – физический номер записи, на которой позиционируется таблица. Если номер превышает число записей таблицы, то VFP генерирует ошибку «Record is out of range».
TOP – позиционирует таблицу на ее первой записи. Если установлен возрастающий управляющий индекс, то первой является запись с наименьшим значением ключа, если – убывающий, то – с наибольшим. Если таблица используется без управляющего индекса, то первой является запись с номером 1. То есть команды GO 1 и GO TOP равноценны. При наличии управляющего индекса в общем случае GO 1 и GO TOP дают разные результаты.
Пример:
close databases
open database d:HomeLibraryHomeLibrary.dbc
&&
&& Управляющий индекс – AuthorId
use Authors order AuthorId
go top in Authors
? Recno(‘Authors’) && Возможный ответ: 7
go 1 in Authors
? Recno(‘Authors’) && Возможный ответ: 1
BOTTOM — позиционирует таблицу на ее последней записи. Если установлен возрастающий управляющий индекс, то последней является запись с наибольшим значением ключа, если – убывающий, то – с наименьшим. Если таблица используется без управляющего индекса, то послендней является запись с номером RECCOUNT( ).
Команда
SKIP [nRecords] [IN nWorkArea | cTableAlias]
перемещает таблицу вперед или назад.
Параметр:
nRecords – число записей, на которое перемещается файловый указатель. Если параметр опущен, но выполняется переход на следующую запись. Перемещение выполняется по направлению к концу файла, если nRecords > 0, и к началу файла, если nRecords < 0.
Если SKIP уведет таблицу в конец файла, то RECNO( ) вернет RCCOUNT( ) + 1, а EOF( ) – .T. Если SKIP переместит таблицу в начало файла, то RECNO( ) вернет 1, а BOF( ) – .T.
Если таблица имеет управляющий индекс (тег или индексный IDX-файл), то SKIP перемещает таблицу, используя порядок, заданный этим индексом.
Команда
SCAN [NOOPTIMIZE] [Scope] [FOR lExpression1] [WHILE lExpression2]
[Commands]
[LOOP]
[EXIT]
ENDSCAN
перемещает файловый указатель в текущей таблице, выполняя помещенную между SCAN и ENDSCAN последовательность операторов Commands для каждой записи таблицы, удовлетворяющей заданным условиям.
Рассматриваемая команда является конструкцией команд SCAN и ENDSCAN, которая может содержать команды LOOP и EXIT.
Команды (опции и параметры см. в табл. 1.7):
LOOP – команда, передающая контроль команде SCAN.
EXIT – команда, обеспечивающая выход из конструкции SCAN…ENDSCAN.
ENDSCAN – команда, завершающая конструкцию SCAN…ENDSCAN.
Замечание. VFP при достижении команды ENDSCAN автоматически выбирает таблицу, которая была текущей перед началом выполнения команды SCAN. Таким образом, внутри конструкции SCAN…ENDSCAN можно выбирать по мере необходимости нужную рабочую область, не помещая непосредственно перед ENDSCAN команду выбора таблицы, которой оперирует команда SCAN.
Пример 1. Просматривается таблица Authors, упорядоченная по коду автора (поле AuthorId). Печатаются фамилии авторов с четными кодами. Печать прекращается, когда код превысит число 20.
close databases
open database ‘d:HomeLibraryHomeLibrary’
use Authors order tag AuthorId
select Authors
scan for Mod(AuthorId, 2) = 0 while AuthorId <= 20
? Author && Печатаем поле Author таблицы Authors
endscan
Тот же результат обеспечивается следующим кодом, содержащим команды DO WHILE … ENDDO и SKIP.
use Authors order tag AuthorId
select Authors
do while AuthorId <= 20 and not Eof( )
if Mod(AuthorId, 2) = 0 then
? Author && Печатаем поле Author таблицы Authors
endif
skip
enddo
Пример 2. Выводятся названия книг. Для каждой книги печатаются имеющиеся в ней произведения.
close databases
open database ‘d:HomeLibraryHomeLibrary’
use Books order tag Book in 0
use BooksContent order tag BookId in 0
select Books
scan
? Book && Печатаем название книги
select BooksContent
if Seek(Books.BookId) then
scan for BooksContent.BookId = Books.BookId
&& Chr(9) – символ табуляции
? Chr(9) + Name && Печатаем название произведения
endscan
else
? Chr(9) + «Произведения не указаны»
endif
&& Автоматически выбирается таблица Books
endscan
Возможный результат:
Волчьи песни
Произведения не указаны
Дочь Ивана, мать Ивана (повесть). Рассказы
Дочь Ивана, Мать Ивана
В ту же землю
Нежданно-негаданно
…
Команда
LOCATE [FOR lExpression1] [Scope] [WHILE lExpression2] [NOOPTIMIZE]
выполняет поиск в текущей таблице первой записи, отвечающей логическому выражению lExpression1.
Файл позиционируется на найденной записи, или в конце, если запись не найдена.
Таблица, в которой выполняется поиск, может быть неиндексированной. В этом случае выполняется последовательный поиск.
Опции и параметры описаны в табл. 1.7.
При задании в FOR условия поиска следует, по возможности, употреблять оптимизируемое выражение lExpression1. Тогда в запросе, создаваемом LOCATE, будет использована рашмор-оптимизация.
Команда LOCATE работает быстрее, чем использование SET FILTER с тем же условием, что и в LOCATE, и GO TOP.
Номер найденной записи возвращает RECNO( ). Если запись найдена, то FOUND( ), если вызвана, вернет .T., если не найдена, то – .F. При этом функция EOF( ) вернет .T., а RECNO( ) – число записей в таблице + 1.
Если SET TALK установлен в ON, то после удачного поиска в статус-строке отобразится номер найденной записи, при неудаче – сообщение «End of Locate scope».
Последующие, отвечающие заданным LOCATE условиям, записи находятся командой CONTINUE.
Функции LOCATE и CONTINUE осуществляют поиск в текущей рабочей области. Если в ней нет открытой таблицы, то возникнет диалог Open.
Пример. Печатаются фамилии всех авторов, начинающиеся с буквы Л, таблицы Authors, открытой без управляющего индекса.
close databases
open database d:HomeLibraryHomeLibrary.dbc
use Authors
select Authors
oldExact = Set(‘EXACT’)
set exact off
locate for Author = ‘Л’
if not Found( ) then
MessageBox(‘Нет авторов с фамилией, начинающейся с буквы Л’)
else
do while Found( )
? Authors.Author
continue
enddo
endif
&& Используем макроподстановку
set exact &oldExact
Команда
CONTINUE
продолжает поиск, начатый предшествующей командой LOCATE.
Команда перемещает файл на следующую запись, отвечающую логическому выражению, заданному в команде LOCATE. Функция FOUND( ), если вызвана, вернет .T.
Если же такой записи больше не имеется, то файловый указатель устанавливается в конце файла. Функция EOF( ), если вызвана, вернет в такой ситуации .T., функция FOUND( ) – .F., функция RECNO( ) – число записей в таблице + 1.
Пример см. в описании команды LOCATE
Команда
SEEK eExpression [ORDER nIndexNumber | IDXIndexFileName
| [TAG] TagName [OF CDXFileName]
[ASCENDING | DESCENDING]] [IN nWorkArea | cTableAlias]
ищет в индексированной таблице запись, значение индексного выражения которой отвечает eExpression.
Файл позиционируется либо на найденной записи, либо в конце файла, если запись не обнаружена. Если запись найдена, то функция FOUND( ) , если вызвана, вернет .T.; если не найдена, то – .F. При этом функция EOF( ) вернет .T.
На результаты поиска влияет установка команды SET NEAR, а также команды SET EXACT: совпадение должно быть полным, если SET EXACT установлен в ON.
Опции и параметры:
eExpression – искомое значение индексного ключа.
nIndexNumber – позиция в списке открытых индексных IDX-файлов и CDX-файлов, по которой выбирается индекс или тег. Порядок нумерации индексов и тегов см. в описании команды SET ORDER.
ORDER IDXIndexFileName – имя IDX-файла, в котором ищется eExpression.
ORDER [TAG] TagName – имя тега, в котором ищется eExpression.
OF CDXFileName – имя CDX-файла, которому принадлежит тег TagName. Опция употребляется, если в разных CDX-файлах таблицы имеются одноименные теги.
Если имеются совпадающие имена IDX-файла и тега, то приоритет имеет IDX-файл.
Если параметр nIndexNumber | IDXIndexFileName | TagNamee опущен, то берется управляющий индекс. Если его нет, то VFP генерирует ошибку.
Если параметр nIndexNumber | IDXIndexFileName | TagNamee имеется, то берется индекс (тег), определяемый этим параметром.
ASCENDING – задает поиск в возрастающем порядке: первоначально ищется первый ключ, отвечающей eExpression.
DESCENDING – задает поиск в убывающем порядке: первоначально ищется последний ключ, отвечающей eExpression.
Пример. Печатаются фамилии всех авторов, начинающиеся с буквы Л, таблицы Authors, открытой с управляющим тегом Author.
close databases
open database d:HomeLibraryHomeLibrary.dbc
use Authors order Author
select Authors
set exact off
seek ‘Л’
if Found( ) then
&& Записи обрабатываются в порядке, определяемом тегом Author
&& Перемещаемся по записям, поле Author которых начинается с буквы Л
do while Authors.Author = ‘Л’ and not Eof( )
? Authors.Author
skip
enddo
else
MessageBox(‘Нет авторов с фамилией, начинающейся с буквы Л’)
endif
Команда
SET NEAR ON | OFF
определяет положение файла (таблицы) после неудачного поиска, выполненного командой SEEK.
Опции:
ON – таблица позиционируется на ближайшей схожей записи, если поиск, выполненный SEEK, неудачен. Функции FOUND( ) и EOF( ), если их употребить после поиска, вернут .F.
OFF – (по умолчанию) таблица позиционируется в конце, если поиск, выполненный SEEK неудачен. Функции FOUND( ) и EOF( ), если их употребить после поиска, вернут соответственно .F. и .T.
Замечание. Функция RECNO(0), вызванная после SEEK, вернет номер ближайшей схожей записи независимо от установки SET NEAR. Если, однако, такая запись не найдена, RECNO(0) вернет 0, а вызов GO RECNO(0) приведет к генерации ошибки.
Установка SET NEAR сохраняется с текущей сессией данных.