Prolog program error 1407

Program error 1407 prolog Message:1407 Functor is not found in a domain (during term reading or converting) Message:1407 Functor is not found in a domain

Program error 1407 prolog

Message:1407 Functor is not found in a domain (during term reading or converting)

Message:1407 Functor is not found in a domain (during term reading or converting)

Очень похоже на: автомобиль не едет!
В чем проблема? Вам перевести?
Как база создавалась?
Сравнивали объявление фактов базы с тем, что в файле базы?
Какие типы данных используются?

Ставьте себя на место тех, к кому Вы обращаетесь и кто будет читать.

domains
откуда, куда, рейс = string
время_отбытия = unsigned
время_прибытия = unsigned
день = unsigned
дата_начала,дата_окончания = unsigned
дни_недели = string

facts — route
nondeterm маршрут(откуда,куда,рейс,время_отбытия,время_прибы тия,день,дата_начала,дата_окончания,дни_недели)

clauses
маршрут(«ХЕЛЬСИНКИ»,»МОСКВА»,»204″,1110,1270,0,201 10225,20110302,»123567″).

find_route():-
existfile(«avia.dat»),
маршрут(X,_,_,_,_,_,_,_,_),
write(X),nl,
consult(«avia.dat»,route).
goal

existfile(«avia.dat») успешен
факт был взят из текста avia.dat.
ошибка выдается на consult(«avia.dat»,route).

Гм. Проблема Message:1407 Functor is not found in a domain (during term reading or converting) — проблема содержимого файла, а не его расширения (это я не shdu)))

И в сто-пицот-первый раз: ГРАЖДАНЕ, НАБИВАЙТЕ БАЗУ НЕПОСРЕДСТВЕННО В ПРОГЕ. В CLAUSES. ИБО ТАМ КОМПИЛЯТОР БУДЕТ ТЫКАТЬ НЕПОСРЕДСТВЕННО В ОШИБКИ. ЗАТЕМ ЗАПУСКАЙТЕ: goal save(. ). — И ОНО САМО СОЗДАСТ И ЗАЛЬЁТ ФАЙЛ РОВНО ТАК, КАК ЕМУ НАДО. ))))))))))))))))))))))))))))))))

буфер обмена довольно умный, он может и ЮНИКОДе держать и не только его, а вот редакторы могут ошибаться. Но чаще всего ошибается пользователь

файл для consult может быть и не ЮНИКОДный, а для ЮНИКОДа принято первые два байта специальные писАть. BOM

Источник

Program error 1407 prolog

10.5 Raising Prolog errors

The following functions allows a C function to raise a Prolog error. Refer to the section concerning Prolog errors for more information about the effect of raising an error (section 6.3).

10.5.1 Managing the error context

When one of the following error function is invoked it refers to the implicit error context (section 6.3.1). This context indicates the name and the arity of the concerned predicate. When using a foreign/2 declaration this context is set by default to the name and arity of the associated Prolog predicate. This can be controlled using the bip_name option (section 10.3.2). In any case, the following functions can also be used to modify this context:

The function Pl_Set_C_Bip_Name(functor, arity) initializes the context of the error with functor and arity (if arity functor is significant). The function Pl_Unset_C_Bip_Name() removes such an initialization (the context is then reset to the last Functor / Arity set by a call to set_bip_name/2 (section 8.22.3). This is useful when writing a C routine to define a context for errors occurring in this routine and, before exiting to restore the previous context.

10.5.2 Instantiation error

The following function raises an instantiation error (section 6.3.2):

10.5.3 Uninstantiation error

The following function raises an uninstantiation error (section 6.3.3):

void Pl_Err_Uninstantiation( PlTerm culprit)

10.5.4 Type error

The following function raises a type error (section 6.3.4):

void Pl_Err_Type(int atom_type, PlTerm culprit)

atom_type is (the internal key of) the atom associated with the expected type. For each type name T there is a corresponding predefined atom stored in a global variable whose name is of the form pl_type_ T . culprit is the argument which caused the error.

Example : x is an atom while an integer was expected: Pl_Err_Type(pl_type_integer, x) .

10.5.5 Domain error

The following function raises a domain error (section 6.3.5):

void Pl_Err_Domain(int atom_domain, PlTerm culprit)

atom_domain is (the internal key of) the atom associated with the expected domain. For each domain name D there is a corresponding predefined atom stored in a global variable whose name is of the form domain_ D . culprit is the argument which caused the error.

Example : x is Pl_Err_Domain(pl_domain_not_less_than_zero, x) .

10.5.6 Existence error

The following function raises an existence error (section 6.3.6):

void Pl_Err_Existence(int atom_object, PlTerm culprit)

atom_object is (the internal key of) the atom associated with the type of the object. For each object name O there is a corresponding predefined atom stored in a global variable whose name is of the form pl_existence_ O . culprit is the argument which caused the error.

Example : x does not refer to an existing source: Pl_Err_Existence(pl_existence_source_sink, x) .

10.5.7 Permission error

The following function raises a permission error (section 6.3.7):

void Pl_Err_Permission(int atom_operation, int atom_permission, PlTerm culprit)

atom_operation is (the internal key of) the atom associated with the operation which caused the error. For each operation name O there is a corresponding predefined atom stored in a global variable whose name is of the form pl_permission_operation_ O . atom_permission is (the internal key of) the atom associated with the tried permission. For each permission name P there is a corresponding predefined atom stored in a global variable whose name is of the form pl_permission_type_ P . culprit is the argument which caused the error.

Example : reading from an output stream x : Pl_Err_Permission(pl_permission_operation_input,
pl_permission_type_stream, x) .

10.5.8 Representation error

The following function raises a representation error (section 6.3.8):

void Pl_Err_Representation(int atom_limit)

atom_limit is (the internal key of) the atom associated with the reached limit. For each limit name L there is a corresponding predefined atom stored in a global variable whose name is of the form pl_representation_ L .

Example : an arity too big occurs: Pl_Err_Representation(pl_representation_max_arity) .

10.5.9 Evaluation error

The following function raises an evaluation error (section 6.3.9):

void Pl_Err_Evaluation(int atom_error)

atom_error is (the internal key of) the atom associated with the error. For each evaluation error name E there is a corresponding predefined atom stored in a global variable whose name is of the form pl_evaluation_ E .

Example : a division by zero occurs: Pl_Err_Evaluation(pl_evaluation_zero_divisor) .

10.5.10 Resource error

The following function raises a resource error (section 6.3.10):

void Pl_Err_Resource(int atom_resource)

atom_resource is (the internal key of) the atom associated with the resource. For each resource error name R there is a corresponding predefined atom stored in a global variable whose name is of the form pl_resource_ R .

Example : too many open streams: Pl_Err_Resource(pl_resource_too_many_open_streams) .

10.5.11 Syntax error

The following function raises a syntax error (section 6.3.11):

void Pl_Err_Syntax(int atom_error)

atom_error is (the internal key of) the atom associated with the error. There is no predefined syntax error atoms.

Example : a / is expected: Pl_Err_Syntax(Pl_Create_Atom(«/ expected»)) .

The following function emits a syntax error according to the value of the syntax_error Prolog flag (section 8.22.1). This function can then return (if the value of the flag is either warning or fail ). In that case the calling function should fail (e.g. returning PL_FALSE ). This function accepts a file name (the empty string C «» can be passed), a line and column number and an error message string. Using this function makes it possible to further call the built-in predicate syntax_error_info/4 (section 8.14.4):

void Pl_Emit_Syntax_Error(char *file_name, int line, int column, char *message)

Example : a / is expected: Pl_Emit_Syntax_Error(«data», 10, 30, «/ expected») .

10.5.12 System error

The following function raises a system error (4.3.11, page *):

void Pl_Err_System(int atom_error)

atom_error is (the internal key of) the atom associated with the error. There is no predefined system error atoms.

Example : an invalid pathname is given: Pl_Err_System(Pl_Create_Atom(«invalid path name»)) .

The following function emits a system error associated with an operating system error according to the value of the os_error Prolog flag (section 8.22.1). This function can then return (if the value of the flag is either warning or fail ). In that case the calling function should fail (e.g. returning PL_FALSE ).

The following function uses the value of the errno C library variable (basically it calls Pl_Err_System with the result of strerror(errno) ).

Example : if a call to the C Unix function chdir(2) returns -1 then call Os_Error() .

Copyright (C) 1999-2021 Daniel Diaz Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. More about the copyright

Источник

Program error 1407 prolog

The predicates catch/3 and throw/1 provide ISO compliant raising and catching of exceptions.

[ISO] catch( :Goal, +Catcher, :Recover ) Behaves as call/1 if no exception is raised when executing Goal . If an exception is raised using throw/1 while Goal executes, and the Goal is the innermost goal for which Catcher unifies with the argument of throw/1, all choice points generated by Goal are cut, the system backtracks to the start of catch/3 while preserving the thrown exception term, and Recover is called as in call/1.

The overhead of calling a goal through catch/3 is comparable to call/1. Recovery from an exception is much slower, especially if the exception term is large due to the copying thereof or is decorated with a stack trace using, e.g., the library library(prolog_stack) based on the prolog_exception_hook/4 hook predicate to rewrite exceptions.

[ISO] throw( +Exception ) Raise an exception. The system looks for the innermost catch/3 ancestor for which Exception unifies with the Catcher argument of the catch/3 call. See catch/3 for details.

ISO demands that throw/1 make a copy of Exception , walk up the stack to a catch/3 call, backtrack and try to unify the copy of Exception with Catcher . SWI-Prolog delays backtracking until it actually finds a matching catch/3 goal. The advantage is that we can start the debugger at the first possible location while preserving the entire exception context if there is no matching catch/3 goal. This approach can lead to different behaviour if Goal and Catcher of catch/3 call shared variables. We assume this to be highly unlikely and could not think of a scenario where this is useful. 79 I’d like to acknowledge Bart Demoen for his clarifications on these matters.

In addition to explicit calls to throw/1, many built-in predicates throw exceptions directly from C. If the Exception term cannot be copied due to lack of stack space, the following actions are tried in order:

  1. If the exception is of the form error(Formal, ImplementationDefined) , try to raise the exception without the ImplementationDefined part.
  2. Try to raise error( resource_error(stack) , global) .
  3. Abort (see abort/0).

If an exception is raised in a call-back from C (see chapter 12) and not caught in the same call-back, PL_next_solution() fails and the exception context can be retrieved using PL_exception().

catch_with_backtrace( :Goal, +Catcher, :Recover ) As catch/3, but if library library(prolog_stack) is loaded and an exception of the shape error(Format, Context) is raised Context is extended with a backtrace. To catch an error and print its message including a backtrace, use the following template:

This is good practice for a catch-all wrapper around an application. See also main/0 from library library(main) .

4.10.1 Urgency of exceptions

Under some conditions an exception may be raised as a result of handling another exception. Below are some of the scenarios:

  • The predicate setup_call_cleanup/3 calls the cleanup handler as a result of an exception and the cleanup handler raises an exception itself. In this case the most urgent exception is propagated into the environment.
  • Raising an exception fails due to lack of resources, e.g., lack of stack space to store the exception. In this case a resource exception is raised. If that too fails the system tries to raise a resource exception without (stack) context. If that fails it will raise the exception ‘$aborted’ , also raised by abort/0. As no stack space is required for processing this atomic exception, this should always succeed.
  • Certain callback operations raise an exception while processing another exception or a previous callback already raised an exception before there was an opportunity to process the exception. The most notable callback subject to this issue are prolog_event_hook/1 (supporting e.g., the graphical debugger), prolog_exception_hook/4 (rewriting exceptions, e.g., by adding context) and print_message/2 when called from the core facilities such as the internal debugger. As with setup_call_cleanup/3, the most urgent exception is preserved.

If the most urgent exceptions needs to be preserved, the following exception ordering is respected, preserving the topmost matching error.

  1. ‘$aborted’ (abort/0)
  2. time_limit_exceeded (call_with_time_limit/2)
  3. error( resource_error(Resource) , Context)
  4. error(Formal, Context)
  5. All other exceptions

Note The above resolution is not described in the ISO standard. This is not needed either because ISO does not specify setup_call_cleanup/3 and does not deal with environment management issues such as (debugger) callbacks. Neither does it define abort/0 or timeout handling. Notably abort/0 and timeout are non-logical control structures. They are implemented on top of exceptions as they need to unwind the stack, destroy choice points and call cleanup handlers in the same way. However, the pending exception should not be replaced by another one before the intended handler is reached. The abort exception cannot be caught, something which is achieved by wrapping the cleanup handler of catch/3 into call_cleanup(Handler, abort) .

4.10.2 Debugging and exceptions

Before the introduction of exceptions in SWI-Prolog a runtime error was handled by printing an error message, after which the predicate failed. If the Prolog flag debug_on_error was in effect (default), the tracer was switched on. The combination of the error message and trace information is generally sufficient to locate the error.

With exception handling, things are different. A programmer may wish to trap an exception using catch/3 to avoid it reaching the user. If the exception is not handled by user code, the interactive top level will trap it to prevent termination.

If we do not take special precautions, the context information associated with an unexpected exception (i.e., a programming error) is lost. Therefore, if an exception is raised which is not caught using catch/3 and the top level is running, the error will be printed, and the system will enter trace mode.

If the system is in a non-interactive call-back from foreign code and there is no catch/3 active in the current context, it cannot determine whether or not the exception will be caught by the external routine calling Prolog. It will then base its behaviour on the Prolog flag debug_on_error:

  • current_prolog_flag(debug_on_error, false)
    The exception does not trap the debugger and is returned to the foreign routine calling Prolog, where it can be accessed using PL_exception(). This is the default.
  • current_prolog_flag(debug_on_error, true)
    If the exception is not caught by Prolog in the current context, it will trap the tracer to help analyse the context of the error.

While looking for the context in which an exception takes place, it is advised to switch on debug mode using the predicate debug/0. The hook prolog_exception_hook/4 can be used to add more debugging facilities to exceptions. An example is the library library(http/http_error) , generating a full stack trace on errors in the HTTP server library.

4.10.3 The exception term

4.10.3.1 General form of the ISO standard exception term

The predicate throw/1 takes a single argument, the exception term, and the ISO standard stipulates that the exception term be of the form error(Formal, Context) with:

    Formal
    the‘formal’ description of the error, as listed in chapter 7.12.2 pp. 62-63 («Error classification») of the ISO standard. It indicates the error class and possibly relevant error context information. It may be a compound term of arity 1,2 or 3 — or simply an atom if there is no relevant error context information.
  • Context
    additional context information beyond the one in Formal . If may be unset, i.e. a fresh variable, or set to something that hopefully will help the programmer in debugging. The structure of Context is left unspecified by the ISO Standard, so SWI-Prolog creates it own convention (see below).
  • Thus, constructing an error term and throwing it might take this form (although you would not use the illustrative explicit naming given here; instead composing the exception term directly in a one-liner):

    Note that the ISO standard formal term expresses what should be the case or what is the expected correct state, and not what is the problem. For example:

      If a variable is found to be uninstantiated but should be instantiated, the error term is instantiation_error : The problem is not that there is an unwanted instantiation, but that the correct state is the one with an instantiated variable.

    In case a variable is found to be instantiated but should be uninstantiated (because it will be used for output), the error term is uninstantiation_error(Culprit) : The problem is not that there is lack of instantiation, but that the correct state is the one which Culprit (or one of its subterms) is more uninstantiated than is the case.

  • If you try to disassemble an empty list with compound_name_arguments/3, the error term is type_error(compound,[]) . The problem is not that [] is (erroneously) a compound term, but that a compound term is expected and [] does not belong to that class.
  • 4.10.3.2 Throwing exceptions from applications and libraries

    User predicates are free to choose the structure of their exception terms (i.e., they can define their own conventions) but should adhere to the ISO standard if possible, in particular for libraries.

    Notably, exceptions of the shape error(Formal,Context) are recognised by the development tools and therefore expressing unexpected situations using these exceptions improves the debugging experience.

    In SWI-Prolog, the second argument of the exception term, i.e., the Context argument, is generally of the form context(Location, Message) , where:

      Location
      describes the execution context in which the exception occurred. While the Location argument may be specified as a predicate indicator ( Name / Arity ), it is typically filled by the library(prolog_stack) library. This library recognises uncaught errors or errors caught by catch_with_backtrace/3 and fills the Location argument with a backtrace.
  • Message
    provides an additional description of the error or can be left as a fresh variable if there is nothing appropriate to fill in.
  • ISO standard exceptions can be thrown via the predicates exported from library(error) . Termwise, these predicates look exactly like the Formal of the ISO standard error term they throw:

    Источник

    Содержание

    1. Program error 1407 пролог
    2. Program error 1407 пролог
    3. 4.10.1 Urgency of exceptions
    4. 4.10.2 Debugging and exceptions
    5. 4.10.3 The exception term
    6. 4.10.3.1 General form of the ISO standard exception term
    7. 4.10.3.2 Throwing exceptions from applications and libraries
    8. Program error 1407 пролог
    9. 4.10.1 Urgency of exceptions
    10. 4.10.2 Debugging and exceptions
    11. 4.10.3 The exception term
    12. 4.10.3.1 General form of the ISO standard exception term
    13. 4.10.3.2 Throwing exceptions from applications and libraries

    Program error 1407 пролог

    Message:1407 Functor is not found in a domain (during term reading or converting)

    Message:1407 Functor is not found in a domain (during term reading or converting)

    Очень похоже на: автомобиль не едет!
    В чем проблема? Вам перевести?
    Как база создавалась?
    Сравнивали объявление фактов базы с тем, что в файле базы?
    Какие типы данных используются?

    Ставьте себя на место тех, к кому Вы обращаетесь и кто будет читать.

    domains
    откуда, куда, рейс = string
    время_отбытия = unsigned
    время_прибытия = unsigned
    день = unsigned
    дата_начала,дата_окончания = unsigned
    дни_недели = string

    facts — route
    nondeterm маршрут(откуда,куда,рейс,время_отбытия,время_прибы тия,день,дата_начала,дата_окончания,дни_недели)

    clauses
    маршрут(«ХЕЛЬСИНКИ»,»МОСКВА»,»204″,1110,1270,0,201 10225,20110302,»123567″).

    find_route():-
    existfile(«avia.dat»),
    маршрут(X,_,_,_,_,_,_,_,_),
    write(X),nl,
    consult(«avia.dat»,route).
    goal

    existfile(«avia.dat») успешен
    факт был взят из текста avia.dat.
    ошибка выдается на consult(«avia.dat»,route).

    Гм. Проблема Message:1407 Functor is not found in a domain (during term reading or converting) — проблема содержимого файла, а не его расширения (это я не shdu)))

    И в сто-пицот-первый раз: ГРАЖДАНЕ, НАБИВАЙТЕ БАЗУ НЕПОСРЕДСТВЕННО В ПРОГЕ. В CLAUSES. ИБО ТАМ КОМПИЛЯТОР БУДЕТ ТЫКАТЬ НЕПОСРЕДСТВЕННО В ОШИБКИ. ЗАТЕМ ЗАПУСКАЙТЕ: goal save(. ). — И ОНО САМО СОЗДАСТ И ЗАЛЬЁТ ФАЙЛ РОВНО ТАК, КАК ЕМУ НАДО. ))))))))))))))))))))))))))))))))

    буфер обмена довольно умный, он может и ЮНИКОДе держать и не только его, а вот редакторы могут ошибаться. Но чаще всего ошибается пользователь

    файл для consult может быть и не ЮНИКОДный, а для ЮНИКОДа принято первые два байта специальные писАть. BOM

    Источник

    Program error 1407 пролог

    The predicates catch/3 and throw/1 provide ISO compliant raising and catching of exceptions.

    [ISO] catch( :Goal, +Catcher, :Recover ) Behaves as call/1 if no exception is raised when executing Goal . If an exception is raised using throw/1 while Goal executes, and the Goal is the innermost goal for which Catcher unifies with the argument of throw/1, all choice points generated by Goal are cut, the system backtracks to the start of catch/3 while preserving the thrown exception term, and Recover is called as in call/1.

    The overhead of calling a goal through catch/3 is comparable to call/1. Recovery from an exception is much slower, especially if the exception term is large due to the copying thereof or is decorated with a stack trace using, e.g., the library library(prolog_stack) based on the prolog_exception_hook/4 hook predicate to rewrite exceptions.

    [ISO] throw( +Exception ) Raise an exception. The system looks for the innermost catch/3 ancestor for which Exception unifies with the Catcher argument of the catch/3 call. See catch/3 for details.

    ISO demands that throw/1 make a copy of Exception , walk up the stack to a catch/3 call, backtrack and try to unify the copy of Exception with Catcher . SWI-Prolog delays backtracking until it actually finds a matching catch/3 goal. The advantage is that we can start the debugger at the first possible location while preserving the entire exception context if there is no matching catch/3 goal. This approach can lead to different behaviour if Goal and Catcher of catch/3 call shared variables. We assume this to be highly unlikely and could not think of a scenario where this is useful. 79 I’d like to acknowledge Bart Demoen for his clarifications on these matters.

    In addition to explicit calls to throw/1, many built-in predicates throw exceptions directly from C. If the Exception term cannot be copied due to lack of stack space, the following actions are tried in order:

    1. If the exception is of the form error(Formal, ImplementationDefined) , try to raise the exception without the ImplementationDefined part.
    2. Try to raise error( resource_error(stack) , global) .
    3. Abort (see abort/0).

    If an exception is raised in a call-back from C (see chapter 12) and not caught in the same call-back, PL_next_solution() fails and the exception context can be retrieved using PL_exception().

    catch_with_backtrace( :Goal, +Catcher, :Recover ) As catch/3, but if library library(prolog_stack) is loaded and an exception of the shape error(Format, Context) is raised Context is extended with a backtrace. To catch an error and print its message including a backtrace, use the following template:

    This is good practice for a catch-all wrapper around an application. See also main/0 from library library(main) .

    4.10.1 Urgency of exceptions

    Under some conditions an exception may be raised as a result of handling another exception. Below are some of the scenarios:

    • The predicate setup_call_cleanup/3 calls the cleanup handler as a result of an exception and the cleanup handler raises an exception itself. In this case the most urgent exception is propagated into the environment.
    • Raising an exception fails due to lack of resources, e.g., lack of stack space to store the exception. In this case a resource exception is raised. If that too fails the system tries to raise a resource exception without (stack) context. If that fails it will raise the exception ‘$aborted’ , also raised by abort/0. As no stack space is required for processing this atomic exception, this should always succeed.
    • Certain callback operations raise an exception while processing another exception or a previous callback already raised an exception before there was an opportunity to process the exception. The most notable callback subject to this issue are prolog_event_hook/1 (supporting e.g., the graphical debugger), prolog_exception_hook/4 (rewriting exceptions, e.g., by adding context) and print_message/2 when called from the core facilities such as the internal debugger. As with setup_call_cleanup/3, the most urgent exception is preserved.

    If the most urgent exceptions needs to be preserved, the following exception ordering is respected, preserving the topmost matching error.

    1. ‘$aborted’ (abort/0)
    2. time_limit_exceeded (call_with_time_limit/2)
    3. error( resource_error(Resource) , Context)
    4. error(Formal, Context)
    5. All other exceptions

    Note The above resolution is not described in the ISO standard. This is not needed either because ISO does not specify setup_call_cleanup/3 and does not deal with environment management issues such as (debugger) callbacks. Neither does it define abort/0 or timeout handling. Notably abort/0 and timeout are non-logical control structures. They are implemented on top of exceptions as they need to unwind the stack, destroy choice points and call cleanup handlers in the same way. However, the pending exception should not be replaced by another one before the intended handler is reached. The abort exception cannot be caught, something which is achieved by wrapping the cleanup handler of catch/3 into call_cleanup(Handler, abort) .

    4.10.2 Debugging and exceptions

    Before the introduction of exceptions in SWI-Prolog a runtime error was handled by printing an error message, after which the predicate failed. If the Prolog flag debug_on_error was in effect (default), the tracer was switched on. The combination of the error message and trace information is generally sufficient to locate the error.

    With exception handling, things are different. A programmer may wish to trap an exception using catch/3 to avoid it reaching the user. If the exception is not handled by user code, the interactive top level will trap it to prevent termination.

    If we do not take special precautions, the context information associated with an unexpected exception (i.e., a programming error) is lost. Therefore, if an exception is raised which is not caught using catch/3 and the top level is running, the error will be printed, and the system will enter trace mode.

    If the system is in a non-interactive call-back from foreign code and there is no catch/3 active in the current context, it cannot determine whether or not the exception will be caught by the external routine calling Prolog. It will then base its behaviour on the Prolog flag debug_on_error:

    • current_prolog_flag(debug_on_error, false)
      The exception does not trap the debugger and is returned to the foreign routine calling Prolog, where it can be accessed using PL_exception(). This is the default.
    • current_prolog_flag(debug_on_error, true)
      If the exception is not caught by Prolog in the current context, it will trap the tracer to help analyse the context of the error.

    While looking for the context in which an exception takes place, it is advised to switch on debug mode using the predicate debug/0. The hook prolog_exception_hook/4 can be used to add more debugging facilities to exceptions. An example is the library library(http/http_error) , generating a full stack trace on errors in the HTTP server library.

    4.10.3 The exception term

    4.10.3.1 General form of the ISO standard exception term

    The predicate throw/1 takes a single argument, the exception term, and the ISO standard stipulates that the exception term be of the form error(Formal, Context) with:

      Formal
      the‘formal’ description of the error, as listed in chapter 7.12.2 pp. 62-63 («Error classification») of the ISO standard. It indicates the error class and possibly relevant error context information. It may be a compound term of arity 1,2 or 3 — or simply an atom if there is no relevant error context information.
  • Context
    additional context information beyond the one in Formal . If may be unset, i.e. a fresh variable, or set to something that hopefully will help the programmer in debugging. The structure of Context is left unspecified by the ISO Standard, so SWI-Prolog creates it own convention (see below).
  • Thus, constructing an error term and throwing it might take this form (although you would not use the illustrative explicit naming given here; instead composing the exception term directly in a one-liner):

    Note that the ISO standard formal term expresses what should be the case or what is the expected correct state, and not what is the problem. For example:

      If a variable is found to be uninstantiated but should be instantiated, the error term is instantiation_error : The problem is not that there is an unwanted instantiation, but that the correct state is the one with an instantiated variable.

    In case a variable is found to be instantiated but should be uninstantiated (because it will be used for output), the error term is uninstantiation_error(Culprit) : The problem is not that there is lack of instantiation, but that the correct state is the one which Culprit (or one of its subterms) is more uninstantiated than is the case.

  • If you try to disassemble an empty list with compound_name_arguments/3, the error term is type_error(compound,[]) . The problem is not that [] is (erroneously) a compound term, but that a compound term is expected and [] does not belong to that class.
  • 4.10.3.2 Throwing exceptions from applications and libraries

    User predicates are free to choose the structure of their exception terms (i.e., they can define their own conventions) but should adhere to the ISO standard if possible, in particular for libraries.

    Notably, exceptions of the shape error(Formal,Context) are recognised by the development tools and therefore expressing unexpected situations using these exceptions improves the debugging experience.

    In SWI-Prolog, the second argument of the exception term, i.e., the Context argument, is generally of the form context(Location, Message) , where:

      Location
      describes the execution context in which the exception occurred. While the Location argument may be specified as a predicate indicator ( Name / Arity ), it is typically filled by the library(prolog_stack) library. This library recognises uncaught errors or errors caught by catch_with_backtrace/3 and fills the Location argument with a backtrace.
  • Message
    provides an additional description of the error or can be left as a fresh variable if there is nothing appropriate to fill in.
  • ISO standard exceptions can be thrown via the predicates exported from library(error) . Termwise, these predicates look exactly like the Formal of the ISO standard error term they throw:

    Источник

    Program error 1407 пролог

    The predicates catch/3 and throw/1 provide ISO compliant raising and catching of exceptions.

    [ISO] catch( :Goal, +Catcher, :Recover ) Behaves as call/1 if no exception is raised when executing Goal . If an exception is raised using throw/1 while Goal executes, and the Goal is the innermost goal for which Catcher unifies with the argument of throw/1, all choice points generated by Goal are cut, the system backtracks to the start of catch/3 while preserving the thrown exception term, and Recover is called as in call/1.

    The overhead of calling a goal through catch/3 is comparable to call/1. Recovery from an exception is much slower, especially if the exception term is large due to the copying thereof or is decorated with a stack trace using, e.g., the library library(prolog_stack) based on the prolog_exception_hook/4 hook predicate to rewrite exceptions.

    [ISO] throw( +Exception ) Raise an exception. The system looks for the innermost catch/3 ancestor for which Exception unifies with the Catcher argument of the catch/3 call. See catch/3 for details.

    ISO demands that throw/1 make a copy of Exception , walk up the stack to a catch/3 call, backtrack and try to unify the copy of Exception with Catcher . SWI-Prolog delays backtracking until it actually finds a matching catch/3 goal. The advantage is that we can start the debugger at the first possible location while preserving the entire exception context if there is no matching catch/3 goal. This approach can lead to different behaviour if Goal and Catcher of catch/3 call shared variables. We assume this to be highly unlikely and could not think of a scenario where this is useful. 79 I’d like to acknowledge Bart Demoen for his clarifications on these matters.

    In addition to explicit calls to throw/1, many built-in predicates throw exceptions directly from C. If the Exception term cannot be copied due to lack of stack space, the following actions are tried in order:

    1. If the exception is of the form error(Formal, ImplementationDefined) , try to raise the exception without the ImplementationDefined part.
    2. Try to raise error( resource_error(stack) , global) .
    3. Abort (see abort/0).

    If an exception is raised in a call-back from C (see chapter 12) and not caught in the same call-back, PL_next_solution() fails and the exception context can be retrieved using PL_exception().

    catch_with_backtrace( :Goal, +Catcher, :Recover ) As catch/3, but if library library(prolog_stack) is loaded and an exception of the shape error(Format, Context) is raised Context is extended with a backtrace. To catch an error and print its message including a backtrace, use the following template:

    This is good practice for a catch-all wrapper around an application. See also main/0 from library library(main) .

    4.10.1 Urgency of exceptions

    Under some conditions an exception may be raised as a result of handling another exception. Below are some of the scenarios:

    • The predicate setup_call_cleanup/3 calls the cleanup handler as a result of an exception and the cleanup handler raises an exception itself. In this case the most urgent exception is propagated into the environment.
    • Raising an exception fails due to lack of resources, e.g., lack of stack space to store the exception. In this case a resource exception is raised. If that too fails the system tries to raise a resource exception without (stack) context. If that fails it will raise the exception ‘$aborted’ , also raised by abort/0. As no stack space is required for processing this atomic exception, this should always succeed.
    • Certain callback operations raise an exception while processing another exception or a previous callback already raised an exception before there was an opportunity to process the exception. The most notable callback subject to this issue are prolog_event_hook/1 (supporting e.g., the graphical debugger), prolog_exception_hook/4 (rewriting exceptions, e.g., by adding context) and print_message/2 when called from the core facilities such as the internal debugger. As with setup_call_cleanup/3, the most urgent exception is preserved.

    If the most urgent exceptions needs to be preserved, the following exception ordering is respected, preserving the topmost matching error.

    1. ‘$aborted’ (abort/0)
    2. time_limit_exceeded (call_with_time_limit/2)
    3. error( resource_error(Resource) , Context)
    4. error(Formal, Context)
    5. All other exceptions

    Note The above resolution is not described in the ISO standard. This is not needed either because ISO does not specify setup_call_cleanup/3 and does not deal with environment management issues such as (debugger) callbacks. Neither does it define abort/0 or timeout handling. Notably abort/0 and timeout are non-logical control structures. They are implemented on top of exceptions as they need to unwind the stack, destroy choice points and call cleanup handlers in the same way. However, the pending exception should not be replaced by another one before the intended handler is reached. The abort exception cannot be caught, something which is achieved by wrapping the cleanup handler of catch/3 into call_cleanup(Handler, abort) .

    4.10.2 Debugging and exceptions

    Before the introduction of exceptions in SWI-Prolog a runtime error was handled by printing an error message, after which the predicate failed. If the Prolog flag debug_on_error was in effect (default), the tracer was switched on. The combination of the error message and trace information is generally sufficient to locate the error.

    With exception handling, things are different. A programmer may wish to trap an exception using catch/3 to avoid it reaching the user. If the exception is not handled by user code, the interactive top level will trap it to prevent termination.

    If we do not take special precautions, the context information associated with an unexpected exception (i.e., a programming error) is lost. Therefore, if an exception is raised which is not caught using catch/3 and the top level is running, the error will be printed, and the system will enter trace mode.

    If the system is in a non-interactive call-back from foreign code and there is no catch/3 active in the current context, it cannot determine whether or not the exception will be caught by the external routine calling Prolog. It will then base its behaviour on the Prolog flag debug_on_error:

    • current_prolog_flag(debug_on_error, false)
      The exception does not trap the debugger and is returned to the foreign routine calling Prolog, where it can be accessed using PL_exception(). This is the default.
    • current_prolog_flag(debug_on_error, true)
      If the exception is not caught by Prolog in the current context, it will trap the tracer to help analyse the context of the error.

    While looking for the context in which an exception takes place, it is advised to switch on debug mode using the predicate debug/0. The hook prolog_exception_hook/4 can be used to add more debugging facilities to exceptions. An example is the library library(http/http_error) , generating a full stack trace on errors in the HTTP server library.

    4.10.3 The exception term

    4.10.3.1 General form of the ISO standard exception term

    The predicate throw/1 takes a single argument, the exception term, and the ISO standard stipulates that the exception term be of the form error(Formal, Context) with:

      Formal
      the‘formal’ description of the error, as listed in chapter 7.12.2 pp. 62-63 («Error classification») of the ISO standard. It indicates the error class and possibly relevant error context information. It may be a compound term of arity 1,2 or 3 — or simply an atom if there is no relevant error context information.
  • Context
    additional context information beyond the one in Formal . If may be unset, i.e. a fresh variable, or set to something that hopefully will help the programmer in debugging. The structure of Context is left unspecified by the ISO Standard, so SWI-Prolog creates it own convention (see below).
  • Thus, constructing an error term and throwing it might take this form (although you would not use the illustrative explicit naming given here; instead composing the exception term directly in a one-liner):

    Note that the ISO standard formal term expresses what should be the case or what is the expected correct state, and not what is the problem. For example:

      If a variable is found to be uninstantiated but should be instantiated, the error term is instantiation_error : The problem is not that there is an unwanted instantiation, but that the correct state is the one with an instantiated variable.

    In case a variable is found to be instantiated but should be uninstantiated (because it will be used for output), the error term is uninstantiation_error(Culprit) : The problem is not that there is lack of instantiation, but that the correct state is the one which Culprit (or one of its subterms) is more uninstantiated than is the case.

  • If you try to disassemble an empty list with compound_name_arguments/3, the error term is type_error(compound,[]) . The problem is not that [] is (erroneously) a compound term, but that a compound term is expected and [] does not belong to that class.
  • 4.10.3.2 Throwing exceptions from applications and libraries

    User predicates are free to choose the structure of their exception terms (i.e., they can define their own conventions) but should adhere to the ISO standard if possible, in particular for libraries.

    Notably, exceptions of the shape error(Formal,Context) are recognised by the development tools and therefore expressing unexpected situations using these exceptions improves the debugging experience.

    In SWI-Prolog, the second argument of the exception term, i.e., the Context argument, is generally of the form context(Location, Message) , where:

      Location
      describes the execution context in which the exception occurred. While the Location argument may be specified as a predicate indicator ( Name / Arity ), it is typically filled by the library(prolog_stack) library. This library recognises uncaught errors or errors caught by catch_with_backtrace/3 and fills the Location argument with a backtrace.
  • Message
    provides an additional description of the error or can be left as a fresh variable if there is nothing appropriate to fill in.
  • ISO standard exceptions can be thrown via the predicates exported from library(error) . Termwise, these predicates look exactly like the Formal of the ISO standard error term they throw:

    Источник

    Smelov

    1 / 1 / 0

    Регистрация: 08.03.2011

    Сообщений: 101

    1

    Не работает пример с динамической базой фактов

    14.03.2011, 13:22. Показов 8598. Ответов 8

    Метки нет (Все метки)


    Мне необходимо считать из файла вопросы и выводить их на экран.

    Для начала решил разобрать этот пример:

    Prolog
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    
    database - maindb
     item(integer)        
     
    predicates
     
     nondeterm input(integer)            
     nondeterm print()
     
    clauses
     
     input(0).
     input(I):- I > 0, readint(X), assert(item(X)), PrI = I - 1, input(PrI).
     
     print:- item(3), write(), write(" "), fail.
     
    goal
      retractall(item(_)), input(5), print.

    но он почему-то не работает, хотя вроде все правильно

    __________________
    Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



    1



    pavelr

    Заблокирован

    14.03.2011, 14:31

    2

    Твой пример просто ждет,пока введешь с клавиатуры 5 чисел и все!Надо,как я понял из внешнего файла считывать вопросы,хранящиеся там как факты?



    2



    1 / 1 / 0

    Регистрация: 08.03.2011

    Сообщений: 101

    14.03.2011, 14:56

     [ТС]

    3

    Цитата
    Сообщение от pavelr
    Посмотреть сообщение

    Твой пример просто ждет,пока введешь с клавиатуры 5 чисел и все!Надо,как я понял из внешнего файла считывать вопросы,хранящиеся там как факты?

    да, именно так!



    0



    pavelr

    Заблокирован

    14.03.2011, 16:13

    4

    Если закинуть все вопросы в файл с расширением .Dba, то твою проблему, учитывая предыдущий вопрос,можно решить так:

    Prolog
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    facts
    quest(string)
    determ l(string)
    predicates
    expert
    clauses
    expert:-assert(l("")),retract(quest(Q)),write(Q),nl,write("Введите ответ на вопрос?Да-1,Нет-0  "),readln(X),
    retract(l(L)),concat(X,L,Newl),asserta(l(Newl)),fail.
    expert:-retract(l(Line)),write("Строка ответов=",Line).
    goal
    consult("C:\Temp\Baza2.dba"),expert.

    Ку-ку…



    2



    Smelov

    1 / 1 / 0

    Регистрация: 08.03.2011

    Сообщений: 101

    14.03.2011, 16:45

     [ТС]

    5

    Цитата
    Сообщение от pavelr
    Посмотреть сообщение

    Если закинуть все вопросы в файл с расширением .Dba, то твою проблему, учитывая предыдущий вопрос,можно решить так:

    Prolog
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    facts
    quest(string)
    determ l(string)
    predicates
    expert
    clauses
    expert:-assert(l("")),retract(quest(Q)),write(Q),nl,write("Введите ответ на вопрос?Да-1,Нет-0  "),readln(X),
    retract(l(L)),concat(X,L,Newl),asserta(l(Newl)),fail.
    expert:-retract(l(Line)),write("Строка ответов=",Line).
    goal
    consult("C:\Temp\Baza2.dba"),expert.

    Ку-ку…

    Несколько вопросов:
    1. Какой формат файла Baza2.dba?
    2. E;questions.pro, pos: 8, 236 The unnamed database must be global in a project. (quest(string))
    E;questions.pro, pos: 270, 122 Unnamed facts section should be declared. (consult(«C:\Temp\Baza2.dba»))



    0



    pavelr

    Заблокирован

    14.03.2011, 19:08

    6

    Факты набираются в Блокноте,и сохраняются, но не как текстовый файл,а как произвольный с расширением .dba. Касаемо остальных ошибок-я работаю в Visual Prolog 5.2,у меня все работает.Если работаешь в Турбо Прологе,то вместо facts нужно писать database.



    1



    1 / 1 / 0

    Регистрация: 08.03.2011

    Сообщений: 101

    14.03.2011, 20:57

     [ТС]

    7

    Цитата
    Сообщение от pavelr
    Посмотреть сообщение

    Факты набираются в Блокноте,и сохраняются, но не как текстовый файл,а как произвольный с расширением .dba. Касаемо остальных ошибок-я работаю в Visual Prolog 5.2,у меня все работает.Если работаешь в Турбо Прологе,то вместо facts нужно писать database.

    У меня тоже VIP 5.2… могу вставить скриншот.

    получается файл dba выглядит примерно так:

    Вопрос1
    Вопрос2
    …..
    ?

    Добавлено через 52 минуты
    Эврика! Чтобы запустилось, необходимо было написать вместо facts -> global facts!

    Однако теперь при запуске выдает следующее:

    PROGRAM ERROR. Module:VIP52BINWIN32QWERTY.PRO Pos:303
    Message:1407 Functor is not found in a domain (during term reading or converting)

    Очевидно, ошибка при чтении. В файле baza.dba записано следующее:

    Вопрос1
    Вопрос2
    Вопрос3
    Вопрос4



    0



    pavelr

    Заблокирован

    14.03.2011, 21:10

    8

    В файле baza.dba должно быть так написано:
    quest(«Вопрос 1») и т.д.



    1



    1 / 1 / 0

    Регистрация: 08.03.2011

    Сообщений: 101

    14.03.2011, 21:24

     [ТС]

    9

    Цитата
    Сообщение от pavelr
    Посмотреть сообщение

    В файле baza.dba должно быть так написано:
    quest(«Вопрос 1») и т.д.

    Спасибо! теперь дошло!



    0



    ———— RUNTIME ERRORS # 1000 Program error! Check source code at reported position # 1001 Gstack overflow. Not enough memory or an endless loop # 1002 Heap overflow. Not enough memory or an endless loop # 1003 Requested block is too big # 1004 Mismatch between freed blocks size and internal record # 1005 Attempt to release already released block # 1006 Heap signature overwritten # 1007 Term too big # 1008 Memory initialization failure # 1009 General protection fault (access violation) # 1010 Stack overflow # 1020 Trail overflow. Use trail=size to get more space # 1024 Object doesn’t exist or an incorrect conversion of the object type # 1025 Call of unknown predicate # 1026 Direct call of a predicate from abstract class # 1027 Invalid class descriptor # 1028 Base class name is identical to the derived class name. # 1030 Arithmetic overflow in real operation # 1031 Arithmetic overflow # 1032 Division by zero # 1033 Invalid value for real operation or function # 1034 Non floating-point format data (NaN or unsupported format) # 1040 Free variables are not allowed here # 1041 Attempt to assert a second instance of a fact declared as determ # 1042 Attempt to retract a fact declared as single # 1045 Index too big # 1046 Size bigger than 64K in makebinarry on 16bit platform # 1047 Invalid term # 1048 Command line is too long # 1050 Program was terminated via exception, code = # 1051 Internal error # 1052 Earlier timemark value is greater then the later one # ————— Data compression predicates # 1081 Invalid input block for compressBinary or expandBinary # 1082 Invalid compress format (binary probably not from compressBinary) # 1083 Internal decode errors (binary probably corrupted) # ———— IO & OS errors # 1101 Attempt to open an already open file # 1102 Attempt to assign input device to a file that is not in readmode # 1103 Attempt to assign output device to a file that is not in writemode # 1104 The file isn’t open # 1105 Illegal mode in filemode predicate, should be 0 or 1 # 1106 Invalid operation on device # 1107 eof can only be used during readmode # 1108 Illegal device or path # 1109 Wrong number of arguments in the format string # 1110 File too big, or not enough memory for file # 1111 Wrong number of bytes read from file # 1112 Not able to write correct number of bytes to file # 1113 Invalid arguments to the ‘date’-predicate # 1114 Invalid arguments to the ‘time’-predicate # 1115 ‘unreadchar’ failed because of full buffer (maximum 128 characters) # 1116 Failure in ‘system’ call # 1117 Error executing external program # 1133 Incorrect operating system version # 1134 Invalid path # 1135 Filename too long # 1136 Unknown ticks (from UNIX sleep.c) # 1137 No newline found in IO_getln # 1138 initsyspath not called (only for UNIX) # 1139 Error calling lp (UNIX) # 1140 Formatted result too large in writef or format # ———————— SCR & WD Error’s # 1201 The arguments in ‘makewindow’ are illegal # 1202 The cursor values are illegal # 1203 The window referred to does not exist # 1205 Maximum number of windows exceeded # 1206 The arguments in ‘resizewindow’ are illegal # 1207 Scroll predicate is not supported in graphic # 1208 Not possible to set indicated textmode # 1209 Operation not possible on system windows # 1210 Illegal operation on a system window # 1211 The window is compressed # 1212 The window is expanded # 1213 Bad framestring: not 6 chars in framestring # 1214 Screen setup failed # 1215 Read/write attempt without input/output device # ————————— DB Error’s # 1301 Overflow in Expanded Memory System # 1302 The database is already open # 1303 Invalid database filename # 1304 The database isn’t open # 1305 The B+Tree isn’t open # 1306 The B+Tree already exists # 1308 The database name already exists in the specified location # 1309 Error reopening the database during flush operation # 1310 Invalid Order value; it must be between 1 and 255 # 1311 Invalid Key length # 1313 Type conflict. The term in the database doesn’t correspond with the domain # 1314 Unable to create the indicated database # 1315 Unable to open the indicated database in the given place # 1316 No EMS installed # 1317 Database marked as invalid # 1318 Unable to delete database in the indicated place # 1319 Invalid database reference number # 1320 The chain does not exist in the database # 1321 The named B+Tree does not exist in the database # 1322 Invalid B+Tree selector for the given database # 1323 Cannot delete an open index. (Close it first) # 1324 Key and ref not found in B+tree during key_delete # 1325 Term too big for conversion # 1326 Incorrect Prolog external database system version # 1327 Not inside transaction # 1328 Write transaction is not allowed when file opened in read-only mode # 1330 Begintransaction made twice without endtransaction # 1331 Update of the database is not allowed in read-only mode # 1332 Timeout in begintransaction # 1333 KEY does already exist, and duplicates are not allowed in selected B+Tree # 1334 Wrong chain or inconsistency in database found in TERM_DELETE # 1335 Only one database can be in_ems when using DB_LOADEMS/DB_SAVEEMS # ————————— Term Reader # 1401 Integer expected (during term reading or converting) # 1402 Real number expected (during term reading or converting) # 1403 Double quote expected (during term reading or converting) # 1404 Single quote expected (during term reading or converting) # 1405 List start expected (during term reading or converting) # 1406 End of list expected (during term reading or converting) # 1407 Functor is not found in a domain (during term reading or converting) # 1408 ‘(‘ expected (during term reading or converting) # 1409 ‘,’ or ‘)’ expected (during term reading or converting) # 1410 ‘$’ expected (during term reading or converting) # 1411 Database reference number expected # ————————— Editor # 1501 Editor text buffer full # 1502 Too many objects for editor # ————————— String handling # 1601 String index error # 1602 Resulting string is too long to be handled under the used platform. # ————————— BGI # 1701 BGI graphics not installed # 1702 Graphics hardware not detected # 1703 Device driver file not found # 1704 Invalid device driver file # 1705 Not enough memory to load driver # 1706 Out of memory in scan fill # 1707 Out of memory in flood fill # 1708 Font file not found # 1709 Not enough memory to load font # 1710 Invalid graphics mode for selected driver # 1711 Graphics error # 1712 Graphics I/O error # 1713 Invalid font file # 1714 Invalid font number # 1715 Invalid device number # 1750 Wrong list length in setfillpattern # ————————— Message # 1801 Message queue memory allocation failure # 1802 The pipe is closed # 1803 The pipe is broken # 1804 Cannot open pipe # 1805 Invalid pipe name # 1806 The pipe is not opened # ————————— Directory browser # 1901 Too many files # ————————— Configuration loading # 2001 Bad configuration file # 2002 Error reading Configuration file # ————————— Offset for signal # 2200 Invalid offset for signal # —————————Errors for CHKDOMS utility # 2401 CHKDOMS.EXE fatal error # 2402 Invalid parameters in command line: # 2403 Out of memory for inner data # 2404 Invalid response file, its contents was ignored # 2405 Invalid or unsupported format of object file # 2406 Suspiciously few parameters # 2407 Object file wasn’t created by PDC Prolog V 4.0 # 2408 Domain not found in module # 2409 Domains sequence is different in module # 2410 Domain differs from one in module # 2411 Extra domain in module # 2412 This file just contains the symbol table # 2413 Too long line was met in the response file, it’s tail is ignored # ————————— UNIX errors # 5001 Not privileged # 5002 No such file or directory # 5003 No such process # 5004 Interrupted system call # 5005 I/O error # 5006 No such device or address # 5007 Arg list too long # 5008 Exec format error # 5009 Bad file number # 5010 No child processes # 5011 Resource temporarily unavailable # 5012 Not enough space # 5013 Permission denied # 5014 Bad address # 5015 Block device required # 5016 Device busy # 5017 File exists # 5018 Cross-device link # 5019 No such device # 5020 Not a directory # 5021 Is a directory # 5022 Invalid argument # 5023 File table overflow # 5024 Too many open files # 5025 Not a typewriter # 5026 Text file busy # 5027 File too large # 5028 No space left on device # 5029 Illegal seek # 5030 Read-only file system # 5031 Too many links # 5032 Broken pipe # 5033 Math argument out of domain func # 5034 Math result not representable # 5035 No message of desired type # 5036 Identifier removed # 5037 Channel number out of range # 5038 Level 2 not synchronized # 5039 Level 3 halted # 5040 Level 3 reset # 5041 Link number out of range # 5042 Protocol driver not attached # 5043 No CSI structure available # 5044 Level 2 halted # 5045 Deadlock condition # 5046 No record locks available # 5060 Device not a stream # 5061 No data available # 5062 Timer expired # 5063 Out of stream resources # 5064 Machine is not on the network # 5065 Package not installed # 5066 Object is remote # 5067 Link has been severed # 5068 Advertise error # 5069 Srmount error # 5070 Communication error on send # 5071 Protocol error # 5074 Multihop attempted # 5075 Inode is remote (not really error) # 5076 Error 76 # 5077 Not a data message # 5078 Filename too long # 5079 Value too large for defined data type # 5080 Name not unique on network # 5081 File descriptor in bad state # 5082 Remote address changed # 5083 Cannot access a needed shared library # 5084 Accessing a corrupted shared library # 5085 .lib section in a.out corrupted # 5086 Attempting to link in more shared library directly # 5087 Cannot exec a shared library directly # 5088 Illegal byte sequence # 5089 Function not implemented # 5090 Operation would block # 5091 Operation now in progress # 5092 Operation already in progress # 5093 Socket operation on non-socket # 5094 Destination address required # 5095 Message too long # 5096 Protocol wrong type for socket # 5097 Protocol not supported # 5098 Socket type not supported # 5099 Operation not supported on transport endpoint # 5100 Protocol family not supported # 5111 Transport endpoint is not connected # 5112 Cannot send after transport endpoint shutdown # 5113 Too many references: cannot splice # 5114 Connection timed out # 5115 Connection refused # 5116 Host is down # 5117 No route to host # 5118 Protocol not available # 5135 Structure needs cleaning # 5137 Not a Xenix system named type file # 5138 No XENIX system semaphores available # 5139 Is a name file # 5140 Remote I/O error: XENIX # 5141 (Reserved for future use) # 5142 (Reserved for future use) # 5145 Directory not empty # 5150 Too many symbolic links in path # 5151 Stale NFS file handle # 5152 Restartable system call # 5153 Stream pipe error # 5500 (Reserved for future use) # ————————— VPI Errors # 6000 Bad window handle # 6001 Invalid window type # 6002 Error allocating data (not enough memory) # 6003 The list must not be empty # 6004 An illegal element in the list # 6005 Unable to open the file # 6006 Unable to create the disk file # 6007 An empty filename string # 6008 This predicate is not supported under the chosen platform # 6009 VPI is not initialized # 6010 Illegal (unknown) parameter value is specified # 6011 Feature is not supported yet # 6050 Cannot find the specified dialog resource # 6051 Cannot find or load the specified cursor resource # 6052 Cannot find or load the specified icon resource # 6053 Cannot find or load the specified menu resource # 6054 Cannot find or load the specified bitmap resource # 6055 Cannot find or load the specified string resource # 6100 Unable to create a valid picture # 6101 Unable to load a picture from the specified file # 6102 Invalid (not w_Picture) window type # 6103 VPI cannot open a picture # 6104 Too many opened pictures # 6120 Unable to kill the specified timer # 6121 Too many timers # 6150 Bad ‘Font’ value in win_SetFont(_, Font) # 6151 Cannot retrieve parameters of the font attached to the specified window # 6152 Unable to create font # 6170 The specified predicate does not exist in the specified DLL # 6171 Unable to run the specified external application # 6172 Wrong application identifier value # 6173 Unable to retrieve the task window handle of the specified external application # 6180 Attempt to start a new print job while printing is already in progress # 6181 System error while preparing the printer driver to print a new page # 6182 System error while starting a print job # 6183 System error while printing the current page # 6184 Cannot initialize a print job # 6185 Forms mismatch (only under OS/2 underlying GUI) # 6186 Wrong printer configuration data # 6200 The list must contain even number of elements # 6210 Too long string (must be <= 64K for 16-bit platforms) # 6220 Unable to register a window class # 6230 win_Destroy is forbidden while e_Destroy event handling # 6231 Drawing is forbidden while e_EraseBackGround event handling # 6260 Unable to add a new string(s) to a list control # 6290 Unable to run MS Windows Help application under WIN-OS/2 environment # 6302 Bad rectangular or invalid control style flag for the control being created # 6304 Unable to create the dialog from the specified dialog resource # 6305 Unable to create a dialog dynamically from a definition contained in a WINDEF_LIST structure # 6306 Unable to create the specified window # 6307 Unable to create a window dynamically from a definition contained in a WINDEF_LIST structure # 6309 Attempt to create a custom control with unregistered window class # 6310 Unable to obtain an identifier of the selected control # 6311 Unable to send the event # 6312 Unable to post the event # 6313 Unable to set input focus to the window # 6314 The string begin position is bigger then the end position # 6315 Unable to adjust the window to the specified client rectangle # 6316 Unable to obtain a window handle of the selected control # 6317 There is no active window in the system # 6351 Impossible to play the specified metafile on the specified device # 6352 Impossible to allocate memory required for loading the specified metafile # 6354 mf_Close() cannot be applied to a window was not created by mf_Open # 6356 Unknown metafile format # 6357 Windowing system cannot create a w_MetaFile window (metafile device context) # 6359 Too many metafiles # 6401 Unable to retrieve a menu from a window or resource file # 6402 The menu handling action is impossible as the window has no menu # 6403 Unable to find the target menu item # 6404 Ownerdraw menu item cannot have submenu. # 6405 In MDI mode the task window must have menu. # 6422 Inaccessible Help application under the current platform # 6450 Unable to access the clipboard # 6454 Data in the clipboard does not coincide with the specified binary format # 6455 Data in the clipboard does not coincide with the bitmap format # 6456 Data in the clipboard does not coincide with the metafile format # ————————— VPI DDE errors # 6600 A request for a synchronous advise message has timed out # 6601 The DDE server is too busy # 6602 A request for a synchronous data message has timed out # 6603 A DDE predicate was called without first calling the dde_Init() # 6604 An application initialized as client has attempted to perform server transactions # 6605 A request for a synchronous execute message has timed out # 6606 A parameter failed to be validated by the DDE predicate # 6607 A DDE application consumed too large amounts of memory # 6608 A memory allocation failed # 6609 A transaction failed # 6610 A client’s attempt to establish a conversation has failed # 6611 A request for a synchronous poke message has timed out # 6612 An internal DDE attempt to post event has failed # 6613 Unable to initiate another transaction, or to execute dde_EnableEvents() # 6614 Unable to complete transaction # 6615 An internal error has occurred in the DDE # 6616 A request to terminate an advise transaction has timed out # 6617 An invalid transaction identifier was passed to a DDE predicate # 6630 An internal DDE error. The maximal number of string handles that can be created by a DDE application is exceeded # 6631 dde_Init fails to register the application as using DDE services # ————————— VPI Text Editor errors # 6900 Specified window is not an editor window # 6901 Error in hyperfield # 6902 Editing text length exceeds the internal maximum limit # 6903 Position is out of range # 6904 Undo list is empty # 6905 Redo list is empty # 6908 Unable to accomplish the operation; exceeded a maximum limit (64K under 16-bit platforms) # 6909 Illegal position is specified # 6910 Operation is forbidden in read-only mode # 6911 Parameter should be positive # ————————— Operating system errors Note that many of these only apply to the OS2 version, and that for OS2 many of the messages are not applicable. They are, however, included for completeness. # 7000 Error while calling of internal OS function. OS error code: # 7001 Invalid function number # 7002 File not found # 7003 Path not found # 7004 Out of handles # 7005 Access denied # 7006 Invalid handle # 7007 Memory control blocks destroyed # 7008 Insufficient memory # 7009 Invalid memory block address # 7010 Invalid environment # 7011 Invalid format # 7012 Invalid access code # 7013 Invalid data # 7014 Unknown unit # 7015 Invalid disk drive # 7016 Cannot remove current directory # 7017 Not same device # 7018 No more files # 7019 Disk write-protected # 7020 Unknown unit # 7021 Drive not ready # 7022 Unknown command # 7023 Data error (CRC) # 7024 Bad request structure length # 7025 Seek error # 7026 Unknown medium type # 7027 Sector not found # 7028 Printer out of paper # 7029 Write fault # 7030 Read fault # 7031 General failure # 7032 Sharing violation # 7033 Lock violation # 7034 Invalid disk change # 7035 FCB unavailable # 7036 Sharing buffer exceeded # 7050 Unsupported network request # 7051 Remote machine not listening # 7052 Duplicate name on network # 7053 Network name not found # 7054 Network busy # 7055 Device no longer exists on network # 7056 NetBIOS command limit exceeded # 7057 Error in network adapter hardware # 7058 Incorrect response from network # 7059 Unexpected network error # 7060 Remote adapter incompatible # 7061 Print queue full # 7062 Insufficient memory for print file # 7063 Print file canceled # 7064 Network name deleted # 7065 Network access denied # 7066 Incorrect network device type # 7067 Network name not found # 7068 Network limit exceeded # 7069 NetBIOS session limit exceeded # 7070 File sharing temporarily paused # 7071 Network request not accepted # 7072 Print or disk redirection paused # 7080 File already exists # 7082 Cannot make directory # 7083 Fail on Int 24H (critical error) # 7084 Too many redirections # 7085 Duplicate redirection # 7086 Invalid password # 7087 Invalid parameter # 7088 Network device fault # 7089 No process slots available # 7090 System error # 7091 Timer service table overflow # 7092 Timer service table duplicate # 7093 No limits to work on # 7095 Interrupted system call # 7100 Open semaphore limit exceeded # 7101 Exclusive semaphore already owned # 7102 DosCloseSem Found semaphore set # 7103 Too many exclusive semaphore requests # 7104 Operation invalid at interrupt time # 7105 Semaphore owner terminated # 7106 Semaphore limit exceeded # 7107 Insert drive B disk into drive A # 7108 Drive locked by another process # 7109 Write on pipe with no reader # 7110 Open/create failed due to explicit fail command # 7111 Buffer too small # 7112 Disk is full # 7113 No more search handles # 7114 Invalid target handle for DosDupHandle # 7115 Bad user virtual address # 7116 Error on display write or keyboard read # 7117 Invalid DosDevIOCtl category # 7118 Invalid value for verify flag # 7119 Driver does not support DosDevIOCtl # 7120 Invalid function called # 7121 Timed out waiting for semaphore # 7122 Insufficient data in buffer # 7123 Invalid character or bad filename # 7124 Unimplemented information level # 7125 No volume label found # 7126 Invalid module handle # 7127 Procedure not found in module # 7128 No child processes found # 7129 Child processes still running # 7130 Invalid handle operation for direct disk access # 7131 Cannot seek to negative offset # 7132 Cannot seek on pipe or device # 7133 Drive has previously joined drives # 7134 Drive is already joined # 7135 Drive is already substituted # 7136 Drive is not joined # 7137 Drive is not substituted # 7138 Cannot join to joined drive # 7139 Cannot substitute to substituted drive # 7140 Cannot join to substituted # 7141 Cannot substitute to joined drive # 7142 Drive is busy # 7143 Cannot join or substitute drive to directory on same drive # 7144 Must be subdirectory of root # 7145 Joined directory must be empty # 7146 Path is already used in substitute # 7147 Path is already used in join # 7148 Path is being used by another process # 7149 Cannot join or substitute drive having directory that is target of previous substitute # 7150 System trace error # 7151 DosMuxSemWait errors # 7152 Systems limit on DosMuxSemWait calls exceeded # 7153 Invalid list format # 7154 Volume label too big # 7155 Cannot create another TCB # 7156 Signal refused # 7157 Segment is discarded # 7158 Segment was not locked # 7159 Bad thread ID address # 7160 Bad environment pointer # 7161 Bad pathname for DosExecPgm # 7162 Signal already pending # 7163 Unknown medium # 7164 No more threads available # 7165 Monitors not supported # 7180 Invalid segment number # 7181 Invalid call gate # 7182 Invalid ordinal # 7183 System object (shared segment, system semaphore, directory, etc.) already exists # 7184 No child process running # 7185 Child process is still alive # 7186 Invalid flag number # 7187 Semaphore does not exist # 7188 Invalid stating code segment # 7189 Invalid stack segment # 7190 Invalid module type # 7191 Wrong EXE file header # 7192 Invalid EXE file, LINK errors # 7193 Invalid EXE format # 7194 Iterated data exceeds 64 KB # 7195 Invalid minimum allocation size # 7196 Invalid dynamic link from ring 2 segment # 7197 IOPL not enabled in CONFIG.SYS # 7198 Invalid segment descriptor privilege limit # 7199 Automatic data segment exceeds 64 KB # 7200 Ring 2 segment must be movable # 7201 Relocation chain exceeds segment limit # 7202 Infinite loop in relocation chain # 7203 Environment variable not found # 7204 Not current country # 7205 NO process with handler to receive signal # 7206 Filename or extension too long # 7207 Ring too stack in use # 7208 Meta expansion too long # 7209 Invalid signal number # 7210 Inactive thread # 7211 File system information not available # 7212 Locked error # 7213 Bad dynamic link # 7214 Too many modules # 7215 Nesting not allowed # 7216 Cannot shrink ring 2 stack # 7230 Non-existent pipe or invalid operation # 7231 Specified pipe is busy # 7232 No data on nonblocking pipe read # 7233 Pipe disconnected by server # 7234 Additional data is available # 7240 Network session was canceled # 7262 Stack too large # 7303 Invalid process ID # 7304 Invalid priority level increment # 7305 Not a descendant process # 7306 Requestor not Task Manager # 7307 Invalid priority class # 7308 Invalid scope # 7309 Invalid thread ID # 7310 Cannot shrink DosSubSet segment # 7311 Out of memory(DosSubAlloc) # 7312 Invalid block specified(DosSubFree) # 7313 Bad size parameter # 7314 Bad flag parameter(DosSubSet) # 7315 Invalid segment selector # 7316 Message too long for buffer # 7317 Message ID number not found # 7318 Unable to access message file # 7319 Invalid message file format # 7320 Invalid insertion variable count # 7321 Unable to perform function # 7322 Unable to wake up # 7323 Invalid semaphore handle # 7324 No timers available # 7326 Invalid timer handle # 7327 Date or time invalid # 7328 Internal system error # 7329 Current queue name does not exist # 7330 Current process is not queue owner # 7331 Current process owns queue # 7332 Duplicate queue name # 7333 Queue record does not exist # 7334 Inadequate queue memory # 7335 Invalid queue name # 7336 Invalid queue priority parameter # 7337 Invalid queue handle # 7338 Queue link not found # 7339 Queue memory error # 7340 Previous queue record was at end of queue # 7341 Process does not have access to queue # 7342 Queue is empty # 7343 Queue name does not exist # 7344 Queues not initialized # 7345 Unable to access queues # 7346 Unable to add new queue # 7347 Unable to initialize queues # 7349 Invalid Vio function replaced # 7350 Invalid pointer to parameter # 7355 Unsupported screen mode # 7356 Invalid cursor width value # 7358 Invalid row value # 7359 Invalid column value # 7366 Invalid wait flag setting # 7367 Screen not previously locked # 7369 Invalid session ID # 7370 No session available # 7371 Session not found # 7372 Title cannot be changed # 7373 Invalid parameter(Kbd) # 7375 Invalid wait parameter # 7376 Invalid length for keyboard # 7377 Invalid echo mode mask # 7378 Invalid input mode mask # 7379 Invalid monitor parameters # 7380 Invalid device name string # 7381 Invalid device handle # 7382 Buffer too small # 7383 Buffer empty # 7384 Data record too large # 7386 Mouse handle invalid or closed # 7389 Invalid display mode parameters # 7391 Invalid entry point # 7392 Invalid function mask # 7394 Pointer drawn # 7395 Invalid frequency for DosBeep # 7396 Cannot find COUNTRY.SYS file # 7397 Cannot open COUNTRY.SYS file # 7398 Country code not found # 7399 Information truncated to fit buffer # 7400 Selected type does not exist # 7401 Selected type not in file # 7402 Vio function for Task Manager only # 7403 Invalid string length(Vio) # 7404 VioDeRegister not allowed # 7405 Pop-up screen not allocated # 7406 Pop-up already on screen # 7407 Kdb function for Task Manager only # 7408 Invalid ASCIIZ string length(Kdb) # 7409 Invalid function replacement mask # 7410 KbdRegister not allowed # 7411 KbdDeRegister not allowed # 7412 Mou function for Task Manager only # 7413 Invalid ASCIIZ string length(Mou) # 7414 Invalid replacement mask # 7415 MouRegister not allowed # 7416 MouDeRegister not allowed # 7417 Invalid action specified # 7418 INIT called more than one # 7419 Screen group number not found # 7420 Caller is not shell # 7421 Invalid parameter(Vio) # 7422 Save/restore already owned # 7423 Thread unblocked by VioModeUndo or VioSavRedrawUndo # 7425 Caller not Task Manager # 7426 VioRegister Not allowed # 7427 No VioModeWait thread exists # 7428 No VioSavRedrawWait thread exists # 7429 Function invalid in background # 7430 Function not allowed during pop-up # 7431 Caller is not the base shell # 7432 Invalid status requested # 7433 No-wait parameter out of bounds # 7434 Cannot lock screen # 7435 Invalid wait parameter # 7436 Invalid Vio handle # 7438 Invalid length for Vio function # 7439 Invalid Kdb handle # 7440 Out of Kbd handles # 7441 Cannot create logical Keyboard # 7442 Code page load failed # 7443 Invalid code page ID # 7445 Keyboard focus required # 7446 Caller already has focus # 7447 Keyboard subsystem is busy # 7448 Invalid code page # 7449 Cannot get keyboard focus # 7450 Session is not selectable # 7451 Parent/child session not in foreground # 7452 Not parent of specified child # 7453 Invalid session start mode # 7454 Invalid session start option # 7455 Invalid session bonding option # 7456 Invalid session select option # 7457 Session started in background # 7458 Invalid session stop option # 7459 Reserved parameter not 0 # 7460 Session parent process already exists # 7461 Invalid data length # 7462 Parent session not bound # 7463 Retry request block allocation # 7464 Unavailable for detached process(Kbd) # 7465 Unavailable for detached process(Vio) # 7466 Unavailable for detached process(Mou) # 7467 No font available to support mode # 7468 User font active # 7469 Invalid code page specified # 7470 System displays do not support code page # 7471 Current display does not support code page # 7472 Invalid code page # 7473 Code page list is too small # 7474 Code page not moved # 7475 Mode switch initialization error # 7476 Code page not found # 7477 Internal error # 7478 Invalid session start trace indicator # 7479 Vio internal Resource error # 7480 Vio shell initialization error # 7481 No Task Manager hard errors # 7482 DosSetCp unable to set display or keyboard code page # 7483 Error during Vio pop-up # 7484 Critical section overflow # 7485 Critical section underflow # 7486 Reserved parameter is not 0 # 7487 Bad physical address # 7488 No selectors requested # 7489 Not enough GDT selectors available # 7490 Not a GDT selector # 7491 Invalid program type # 7492 Invalid program control # 7493 Invalid program inheritance option # 7494 Vio function not allowed in PM window # 7495 Function not supported in non PM screen group # 7496 Vio shield already owned # 7497 Vio handle exhausted # 7498 Vio error occurred, details sent to error log # 7499 Invalid display context # 7500 Kbd input not available # 7501 Mou input not available # 7502 Invalid mouse handle # 7503 Invalid debugging parameters # 7504 Kbd function not allowed in PM window # 7505 Mou function not allowed in PM window # 7506 Invalid icon file # ———————— ODBCBIND Package errors # 8800 Unidentified error in ODBCBIND package. # 8801 Invalid handle. ODBCBIND package. # 8802 A function that was started asynchronously is still executing. ODBCBIND package. # 8803 Application needs to send data. ODBCBIND package. # 8804 No data found. ODBCBIND package. # 8805 Illegal SQL request from ODBCBIND package predicate. # 8806 ODBCBIND package function failed. # ———————— SockBind Package errors # 8901 Repeated attempt to initialize Sockets system # 8902 Sockets system has not been initialized # 8903 Invalid parameter for a SockBind package predicate # 8904 Native Sockets system (see documentation for the Sockets installed on your computer) error. # ———————— Message Layer Package errors # 8930 Native Sockets system cannot be initialized # 8931 A name of a remote host cannot be resolved # 8932 A new socket cannot be created # 8933 A connection cannot be established # 8934 A socket cannot be set to a listen mode # 8935 A socket cannot be closed # 8936 An information cannot be sent # 8937 Internal Message Layer error # 8938 An option cannot be set # 8939 A remote information cannot be retrieved # ———————— HTTP Layer Package errors # 8950 Invalid or unknown HTTP header in a request or response # 8951 Invalid date or time format in a request or response # 8952 Invalid Response format # ————————— VPI Packages Errors # 9000 Specified window is not created as the window of the package the predicate belongs to. # 9001 Specified identifier does not exist # 9002 Identifier specifies resource of a wrong type # 9003 CtlType in ownerdraw_CreateControl(CtlType,…) must be:wc_PushButton,wc_CheckBox,or wc_RadioButton. # 9004 Illegal parameter value. # 9005 Unrecoverable internal error in VPI package. #
    > Форум: Prolog   > Отметить этот форум прочитанным
    Название Автор Ответов Просмотров Обновление
    Нет новых сообщений   шахматная задача на турбо прологе
    [?]

     
    GansEast 0 2229 27.4.2012, 02:58
    Автор: » GansEast
    Нет новых сообщений   Задача на строки
    [?]

    строки, удаление, повтор 
    botasa 0 2418 13.4.2012, 18:01
    Автор: » botasa
    Нет новых сообщений   Need HELP
    [?]

    Prolog program 
    4NcieN2 0 2857 1.4.2012, 05:14
    Автор: » 4NcieN2
    Нет новых сообщений   Найти количество не парных чисел
    [?]

     
    katerinaа 0 3760 20.3.2012, 10:02
    Автор: » katerinaа
    Нет новых сообщений   Найти значение переменной
    [?]

     
    katerinaа 0 2227 20.3.2012, 10:00
    Автор: » katerinaа
    Нет новых сообщений   Prolog Editor для NetBeans
    [?]

     
    tumanovalex 0 4300 3.2.2012, 11:58
    Автор: » tumanovalex
    Нет новых сообщений   Немного исправить код
    [?]

    sum_tree( T, Sum) true если Sum = сум Т 
    DomSmile 1 3829 30.12.2011, 12:49
    Автор: » DomSmile
    Нет новых сообщений   Не могу разобраться с терминами
    [?]

     
    Alexey91 0 2646 29.12.2011, 19:06
    Автор: » Alexey91
    Нет новых сообщений   Вычисление n-го члена ряда
    [?]

     
    DunhiL11 2 3376 26.12.2011, 05:21
    Автор: » craua
    Нет новых сообщений   Помогите!
    [?]

    задача с графами. 
    FeaTea 0 2781 25.12.2011, 09:24
    Автор: » FeaTea
    Нет новых сообщений   деревья в прологе
    [?]

    поиск пути к элементу 
    CraZzZyk 14 5349 23.12.2011, 22:18
    Автор: » CraZzZyk
    Нет новых сообщений   [swi] Описать Findall.
    [?]

     
    АнастасияР 0 2726 23.12.2011, 19:29
    Автор: » АнастасияР
    Нет новых сообщений   Завтра экзамен помогите решыть задания
    [?]

     
    sanyok20000 0 2562 23.12.2011, 17:20
    Автор: » sanyok20000
    Нет новых сообщений   путь по дереву
    [?]

    прорисовка дерева 
    CraZzZyk 0 2568 22.12.2011, 22:35
    Автор: » CraZzZyk
    Нет новых сообщений   Символ встречающийся в списке наибольшее число раз
    [?]

     
    Nastassja 0 2518 20.12.2011, 20:17
    Автор: » Nastassja
    Нет новых сообщений   Символьное интегрирование
    [?]

     
    Vovulya 5 3518 19.12.2011, 19:45
    Автор: » Фантом
    Нет новых сообщений   Попадание в заштрихованную область
    [?]

     
    DunhiL11 1 4856 19.12.2011, 19:38
    Автор: » Фантом
    Нет новых сообщений   Задачи на Trubo Prolog. Решите за плату
    [?]

     
    DunhiL11 0 2329 19.12.2011, 17:01
    Автор: » DunhiL11
    Нет новых сообщений   [SWI] поменять диагонали квадратной матрицы
    [?]

     
    sweetdream 0 3043 19.12.2011, 10:54
    Автор: » sweetdream
    Нет новых сообщений   Список, элементы которого – непустые бинарные дере
    [?]

     
    aki295 0 3171 18.12.2011, 15:12
    Автор: » aki295
    Нет новых сообщений   Логическая задача на Turbo / Visual Prolog!
    [?]

    =( нужен код, я полный ноль 
    mmaker 0 3508 7.12.2011, 11:45
    Автор: » mmaker
    Нет новых сообщений   Советы по планированию воздушного путешествия
    [?]

    Реализовать на Visual Prolog 5.2 
    Евгенияяяя 1 2531 5.12.2011, 21:36
    Автор: » Евгенияяяя
    Нет новых сообщений   Логическая задача на Prolog
    [?]

     
    flogiston 1 5741 5.12.2011, 14:53
    Автор: » alina2011
    Нет новых сообщений   Работа со списками(циклическая)
    [?]

     
    kasperr 2 2388 25.11.2011, 14:14
    Автор: » kasperr
    Нет новых сообщений   Задача — приложение списков, средства упр. док-вом
    [?]

     
    Takushika 0 1708 23.11.2011, 21:59
    Автор: » Takushika
    Нет новых сообщений   Задача на обработку списков
    [?]

    определение среднего значения элементов  
    Takushika 0 1705 23.11.2011, 21:55
    Автор: » Takushika
    Нет новых сообщений   Поиск информации в базе данных
    [?]

    Поправьте готовую программу 
    fenix63 0 3288 22.11.2011, 19:03
    Автор: » fenix63
    Нет новых сообщений   Prolog
    [?]

    Родственные отношения 
    Sevil 0 1753 21.11.2011, 18:15
    Автор: » Sevil
    Нет новых сообщений   Итеративный алгоритм
    [?]

     
    flogiston 0 1948 21.11.2011, 16:50
    Автор: » flogiston
    Нет новых сообщений   задача на прологе
    [?]

    нужна помощь в написании кода программы 
    alexey1944 1 1812 17.11.2011, 09:46
    Автор: » alexey1944
    Нет новых сообщений   сортировка списка
    [?]

     
    good1986 0 1832 9.11.2011, 21:25
    Автор: » good1986
    Нет новых сообщений   Сумма ряда
    [?]

     
    flogiston 2 3686 7.11.2011, 10:19
    Автор: » flogiston
    Нет новых сообщений   непонятная ошибка
    [?]

    error 1407 
    redwhite90 1 1795 6.11.2011, 02:56
    Автор: » redwhite90
    Нет новых сообщений Prolog. Путь от корня дерева, к указанному элемент
    [?]

     
    ROKI 5 3912 31.10.2011, 01:57
    Автор: » Фантом
    Нет новых сообщений   ханойские башни
    [?]

     
    redwhite90 2 2043 30.10.2011, 12:22
    Автор: » redwhite90
    Нет новых сообщений   swi prolog,пара задач
    [?]

    нужна помощь 
    stan90 1 2275 29.10.2011, 13:47
    Автор: » Фантом
    Нет новых сообщений   Пролог поиск в ширину
    [?]

     
    lolli 0 4316 20.10.2011, 22:55
    Автор: » lolli
    Нет новых сообщений   Упростить программочку
    [?]

     
    lolli 0 1996 17.10.2011, 21:29
    Автор: » lolli
    Нет новых сообщений Логическая задача про лошадей
    [?]

     
    ТаняСВ 0 2790 13.10.2011, 21:28
    Автор: » ТаняСВ
    Нет новых сообщений   Помогите!)
    [?]

    объяснить решенную задачу 
    alexey1944 2 1694 12.10.2011, 20:04
    Автор: » alexey1944
    0 Чел. просматривают этот форум (0 Гостей, 0 Скрытых пользователей)
    0 Пользователей:

    Отображено 40 из 455 тем отсортировано по в за  

    Topic: [SOLVED] TTaskdialog -> console app : error 1407  (Read 2830 times)

    Hi all,

    I was thinking to create a little application that calls the TTaskdialog. It might seem foolish doing it like this but the objective was to send the command + parameters from another program, then write the output to a file, file back into other program, done.

    First test crashes with error:

    1. Failed to create win32 control, error 1407

    So it needs a windows something ??

    This is my initial setup (I might be totally wrong too about this)

    1. program msgdlg2;

    2. {$mode objfpc}{$H+}

    3. uses

    4.   Classes,

    5.   SysUtils,

    6.   Dialogs,

    7.   Interfaces,

    8.   Windows,

    9.   CustApp,

    10.   Messages,

    11.   Forms,

    12.   Controls,

    13.   Graphics;

    14. type

    15. { TCreateMsgDlgApplication }

    16.   TCreateMsgDlgApplication = class(TCustomApplication)

    17. public

    18. procedure Run;

    19. end;

    20. { TCreateMsgDlgApplication }

    21. procedure TCreateMsgDlgApplication.Run;

    22. var

    23.     TaskDialog: TTaskDialog;

    24.     Button: TTaskDialogBaseButtonItem;

    25. begin

    26. with TTaskDialog.Create(self) do

    27. try

    28.         Title := ‘Confirm removal’;

    29.         Caption := ‘Confirm’;

    30.         Text := ‘Remove selected item?’;

    31.         CommonButtons := [];

    32. with TTaskDialogButtonItem(Buttons.Add) do

    33. begin

    34.           Caption := ‘Remove’;

    35.           ModalResult := mrYes;

    36. end;

    37. with TTaskDialogButtonItem(Buttons.Add) do

    38. begin

    39.           Caption := ‘Keep’;

    40.           ModalResult := mrNo;

    41. end;

    42.         MainIcon := tdiQuestion;

    43. if Execute then

    44. if ModalResult = mrYes then

    45.             ShowMessage(‘Item removed’);

    46. finally

    47.         Free;

    48. end;

    49. end;

    50. var

    51.   AppDlg: TCreateMsgDlgApplication;

    52. begin

    53.   AppDlg := TCreateMsgDlgApplication.Create(nil);

    54.   AppDlg.Run;

    55.   AppDlg.Free;

    56. end.

    Do I need to include something else or am I totally going in the wrong direction ?

    Project in attached.

    « Last Edit: June 20, 2018, 10:42:35 pm by scons »


    Logged

    Windows 10-64bit Lazarus 2.0.12 + FPC 3.2.0


    You need to initialize the widgetset before you can use that.
    And yes, I know it is not Delphi compatible.

    Bart


    Logged


    First test crashes with error:

    1. Failed to create win32 control, error 1407

    So it needs a windows something ??

    Win32 error 1407 is ERROR_CANNOT_FIND_WND_CLASS, which means the task dialog’s window class hasn’t been registered.

    Task Dialogs require ComCtrl32.dll v6, so make sure your EXE is adequately manifested to enable that (see Enabling Visual Styles on MSDN).  And make sure your app is calling InitCommonControls/Ex() at runtime, either directly or via some FreePascal widget unit that handles that for you.


    Logged


    Thanks for your responses, got me thinking,

    Menu : Project -> Project Options ->Application -> For Windows -> enabeling the checkbox «Use manifest resource (and enable themes)»
    did the trick no error, runs fine.

    Thanks !


    Logged

    Windows 10-64bit Lazarus 2.0.12 + FPC 3.2.0


    Понравилась статья? Поделить с друзьями:
  • Protoc gen go error inconsistent package import paths
  • Protobuf parse error required fields missing cannot determine missing fields for lite message
  • Protherm ошибка f85 разблокировать котел
  • Protherm ошибка f62 pantera
  • Protherm ошибка f61