Hello, World! in Prolog

Example for versions Visual Prolog 7.2

Visual Prolog provides automatic project creation, so you have to create a new project, choose “Console” as UI Strategy, navigate to file main.pro and replace its contents with the given code. The code differs from the standard one only in terms stdio::write (to write the message to the console) and programControl::sleep (to pause program execution).

implement main
    open core

constants
    className = "main".
    classVersion = "".

clauses
    classInfo(className, classVersion).

clauses
    run():-
        console::init(),
        stdio::write("Hello, World!"),
        programControl::sleep(1000),
        succeed().
end implement main

goal
    mainExe::run(main::run).