>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  User

J OLE Automation Server

There are two servers:

  • JEXEServer is the full J development system and is intended for use in developing applications. This is the same J.EXE file that provides the regular J development system.

  • JDLLServer is the J interpreter only, and is intended for runtime applications. This is in file J.DLL.

    An EXE server runs as a separate application from the client, i.e. is a local server. JEXEServer provides the full J development system, which makes it easy to develop and debug applications. As a developer, you have full access to both the client and the J server environments.

    A DLL is part of the client application and uses the same memory space, i.e. is an in-process server. A client accesses DLL services almost as efficiently as it accesses its own native services. The JDLLServer is not as convenient as JEXEServer for development purposes, but it is very efficient and is ideal for runtime applications.

    Typically, you develop your application using JEXEServer, and run it using the JDLLServer.

    Note that JEXEServer and JDLLServer are 32bit servers and are designed for 32bit clients. It may be possible to use JEXEServer from 16bit clients, but this is not officially supported.

    J.DLL can be called directly as an ordinary DLL, without using OLE. For more information, see online help DLLs and Memory Management.

    Clients
    Any application with OLE Automation controller support, such as Visual Basic, Delphi, Excel, or a Visual C++ application, can use JEXEServer and JDLLServer. Also, any application that can call 32bit DLLs can access JDLLServer.

    Registration
    JEXEServer and JDLLServer must be registered with your system before they can be used. To do so, you run JREG.EXE , which is stored in the same directory as J.EXE, i.e. select Start/Run and enter:

    c:\j401\jreg.exe (use the correct directory name)

    If there are problems later when accessing the J servers it may be because they are no longer properly registered. You can always run JREG.EXE to register the servers again. In particular, you will need to do this if you move the J system files to another directory, or if for some reason, the Registry is damaged and you have to recover an old version.

    Using the J OLE Automation servers
    The steps are fairly straightforward, but may differ in minor ways from one client to another.

    You should be familiar with both the J system and the client before tackling them in a client/server combination.

    First load the client application and ensure it references the J servers. You need only select the server you intend to use, but when experimenting, you should check both:

    Once the J servers are referenced, you can check the methods available, which are as follows.

    Break

    interrupt J execution

    Clear

    erases all definitions in J

    Do

    execute a J sentence

    ErrorText/ErrorTextM

    get error text (run after a J error)

    Get/GetB/GetM

    get the value of a J variable

    IsBusy

    returns 0 if J is ready to execute, else an error code

    Log

    display (1) or discard (0) the J EXE session log

    Quit

    causes J EXE server to close when last object is released

    Set/SetB/SetM

    set a value to a J variable

    Show

    show (1) or hide (0) the J EXE server

    Transpose

    return array data transposed

    For details, see file system\examples\data\jdll.h.

    Note that methods Show and Log are ignored by a JDLLServer.

    Once the J servers have been referenced, their methods become available for use by the client. You should declare the J server as an object in the client, and can then reference that object in order to access the J server methods.


    >>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  User