CyberTools logo

About M/Caché Tools: Products

CyberTools: a User Interface Management System (UIMS) and Development Environment.

CyberJ® / CyberTools for the Web
CyberTools for the Java (TM) platform. Run your CyberTools applications interactively over the Web.

Integrate M Data into your favorite PC applications.

Build & deploy telnet (character) windowing for M Technology/Caché

CyberTools® Object Library

CyberTools for the Web

What is CyberJ? You know CyberTools for harnessing new technologies for you to create applications that are more efficiently developed and maintained. Now, you don't need to program in the Java (TM) or C++ languages to reap the benefits of intrinsically cross-platform Java (TM) technology. Your M applications run virtually everywhere and look terrific: you're Web- and Internet-ready today!

Top 10 Reasons to Use CyberJ for Your M / Caché Application.
1. Easiest Way to Web-Enable. If you're an M expert, you're also a webmaster with CyberTools. Build new or leverage your rich legacy application today into the Internet, Intranets and Web with the most popular and mature user interface management system tools for M. Build fast with the least programming.
2. Build it Once. Build an application with any of our tools, and your application runs today on a vast array of platforms, including the Web, Microsoft Windows, character terminals, X/Motif, and Macintosh.
3. No Labor-Intensive HTML or CGI Forms Coding. You're using CyberTools' mature WYSIWYG Visual Development Environment to build your new application or re-use M code.
4. It's the Only High Performance M to Web Solution. CyberTools' hallmark high performance means there is a direct connection between your M and Java Applets. Older web technology uses multiple layers, which is slower. This is network friendly with only one socket for the entire session and for all objects (HTML and CGI use a socket per object).
6. Use Any Web Browser that Runs the Java Platform. Including Netscape Navigator and Microsoft Explorer.
7. Choose 2 or 3 Tier Solutions. Two tier are the fastest, least network intensive solutions. And, CyberJ works with all Web servers, even free public domain and shareware servers.
8. 100% Real-time Access to M. This is the only M web solution that keeps you connected. M is one of the finest scripting languages available. Any other solution is a complex hybrid, slower and more prone to errors.
9. Build New, Exciting Web Applications Faster. Use M and CyberTools to build your new application and get your message (and data!) out into your organization with an Intranet or into the world on the Internet.
10. The Future of the Java (TM) Platform Looks Great! As it grows, so will your M application when it is implemented in CyberTools.

What You'll Need:
• An M with a TCP/IP binding (at least DSM 6.2, DTM 4.4, ISM 5.7, or MSM 4.0.9).
• A TCP/IP that M can access on your M's host operating system.
• A workstation with a web browser running the Java platform.

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.

Back to the Top

1. Introduction to CyberBus. CyberBus transports data between the M and Windows environments, and can run programs in the Windows environment.

2. M Starts a PC Application: LAUNCH^cywapi
Purpose: an M application initiates a PC application across a TCP/IP connection.
Format: Do LAUNCH^cywapi(PCprogrm,paralist,flags) where
PCprogrm = the name of the Windows executable. The name alone will suffice if it's path is included in the PATH environment variable; otherwise the full path should be included.
paralist = a space separated list of parameters which the PC application will recognize.
flags = nil causes the program to be run asynchronized to the M process; "W" makes the M process wait for the PC application to finish before resuming the M process (i.e., synchronized).

This call causes a program to be executed on the Windows system where the current CyberWin! session is running. The program may be a .EXE, or .COM, or .BAT file.

Do LAUNCH^cywapi("notepad","D:\temp\test.txt","W") Set A=1 tells CyberBus to run the Microsoft Notepad program on the associated workstation. It will edit a file call test.txt in the directory D:\temp, and the M process will wait for Notepad to terminate before assigning 1 to A.

3. M Builds Data in a PC File: PUTFILE^cywapi
Purpose: M builds a PC file via TCP/IP. This call creates a file on the target Windows system and fills it with records retrieved by multiple calls to a M Xecute.
Format: Do PUTFILE^cywapi(PCfile,MXecute) where PCfile= the target Windows systems PC filename. The path must be included.
MXecute= M eXecutable code that yields the M variable X.
X contains the data to be moved to the PC. X is linefeed delimited with a maximum length 509. Each linefeed delimited piece becomes a record (a line) in the file. This eXecute is a callback, i.e., it is invoked repeatedly by CyberBus until X="". A nil X tells CyberBus that all of the data are moved to the target. CyberBus will assign nil to X prior to invoking the callback eXecute, i.e., CyberBus does this:
Set X="" Xecute Mxecute

Example 1:
Set line=0
Set callback="S:line<5 line=line+1,X=""datum ""_line"
Do PUTFILE^cywapi("D:\temp\test.txt",callback)
will build a file called test.txt on the associated workstation with the following five lines of text:
datum 1
datum 2
datum 3
datum 4
datum 5

Example 2: A more efficient callback for the above example follows.
S line=0
S fast="Q:line F line=1:1:5 S X=X_""datum ""_line_$C(10)
Do PUTFILE^cywapi("D:\temp\test.txt",fast)

4. Move a M Reference to PC File: PUSHFILE^cywapi
Purpose: creates a file on the Windows system from a M array or from the contents of a M routine (i.e., its code).
Format: Do PUSHFILE^cywapi(type,Mref,PCfile,flags) where type = "M" for pushing a M global/local array or "R" for pushing a M routine.
Mref = the corresponding M global/local array reference or M routine name.
PCfile = the target file name on the Windows system flags = optional, nil, or "T" for tabs in a M Routine.

When the type is "M", then CyberBus will $Order at the level immediately below the M structure named in the Mref, passing to the PC file any node that has a value, including nil. Nodes which do not have a value (i.e., $D(@MRef@(node))=10 ) have no representation in the PC file, i.e., such nodes are ignored. Each node's value becomes a record (a line) in the PC file.

Example 1: moving a M array.
For line=1:1:20 Set text(line)="This is line "_line
Do PUSHFILE^cywapi("M","text","D:\temp\test.txt")
moves the array to the file test.txt on the PC. The difference between PUSHFILE and PUTFILE is PUSHFILE covers simple M data structures, whereas PUTFILE can move unstructured (logical) data.

Example 2: moving a M routine. Given the following M routine MyM:
MyM ; this is a simple M routine
Set A=1 Q
Then the call:
Do PUSHFILE^cywapi("R","MyM","D:\temp\MyM.M","T")
will move the M routine ^MyM to MyM.M, a PC file, with tabs to delimit a line's label from its code.

5. Move a PC file to M: GETFILE^cywapi
Purpose: copies a PC file to M.
Format: Do GETFILE^cywapi(PCfile,MXecute,flags) where
PCfile = source file name on Windows system
MXecute = M eXecute callback to receive the data in M.
This eXecute is given the M variable X with the data, where the lines of the file are delimited by linefeed. The callback is invoked repeatedly until all of the file's data are moved to M.
flags = nil for no additional actions; "D" to delete Windows file when finished.

Example: given the file D:\temp\test.txt
datum 1
datum 2
datum 3
datum 4
datum 5

and given the following M code:

Kill ^Got($Job)

Set L=0,LF=$C(10)
Set Xcb="F P=1:1:$L(X,LF) S L=L+1,^Got($Job,L)=$P(X,LF,P)"
Do GETFILE^cywapi("D:\temp\test.txt",Xcb)
Set ^Got($Job)=L ;count of lines
Quit ;now ^Got($Job) contains get_me.txt

produces this global:

^Got($J,1)="datum 1"
^(2)="datum 2"
^(3)="datum 3"
^(4)="datum 4"
^(5)="datum 5"

6. Copy a PC file to a M Reference: PULLFILE^cywapi
Purpose: copy a PC file to a M global/local array or a M routine.
Format: Do PULLFILE^cywapi(type,Mref,PCfile,flags) where
type = "M" if the target M structure is a global/local variable array reference; "R" if the target M structure is a M routine.
Mref = if type is "M", then this is your M array reference; if type is "R", then this is your M routine name.
PCfile = source file name on Windows system.
flags = nil for no additional actions; "C" stores the line count at @Mref if type="M"; "D" to delete the Windows' source file when finished. These flags may be combined.

The lines from the file will be stored in successive array nodes indexed from 1 to maximum at the index level just below the array reference given by outfile, and the node at outfile will contain the line count, starting at one.

Example 1: given the file D:\temp\test.txt
datum 1
datum 2
datum 3
datum 4
datum 5

and given the following M code:

Kill ^Got($Job)
Do PULLFILE^cywapi("M","^Got($J)","D:\temp\test.txt","C")

produces this M global:

^Got($J,1)="datum 1"
^(2)="datum 2"
^(3)="datum 3"
^(4)="datum 4"
^(5)="datum 5"

Example 2: given D:\temp\mym.m contains a M routine
MyM ;can this be retrieved to M?
W !,"Sure can!",!,*7 Q

then this call:

Do PULLFILE^cywapi("R","MyM","D:\temp\mym.m")

will create the M routine ^MyM identical to the contents of the file D:\temp\mym.m.

7. Create a Bit Map (*.BMP): CREATBM^cywapi
Purpose: captures the current image of a window on the PC where the current CyberWin! session is running and saves it to a bitmap (*.BMP) file. CREATBM is essentually a "screen scraper."
Format: Do CREATBM^cywapi(HWND,PCfile) where:
HWND = window handle in decimal (use MSVC++ Spy to receive)
PCfile = file name of bitmap file created. This call is mostly used by CyberTools Hypertext to build Microsoft's WINHELP.EXE hypertext.

8. M invokes a PC Shell Command: SHELL^cywapi
Purpose: invokes a console window on the target system and executes a Microsoft Shell command.
Format: Do SHELL^cywapi(COMMAND) where COMMAND is a legal shell command, e.g.,


9. GUI M Routine Editor via CyberBus: ^cywedit
^cywedit is a useful example of how to combine some of the above CyberBus features. This routine allows you to select a M routine, moves the M routine to the PC, allows you to edit it with the Microsoft Notepad editor, and then returns the routine to M.

cywedit ; demo M routine editor in GUI via CyberBus.
New filename,routine
main Set routine=$$func^cyur("",5,12,20,"","Edit Routine ")
Set filename="D:\TEMP\"_routine_".m"
Do PUSHFILE^cywapi("R",routine,filename,"T")
Do LAUNCH^cywapi("NOTEPAD",filename,"W")
Set X=$$func^cyumenu("5,10\RHLP\2\Save ^"_routine_"?\1\
If +X=1 Do PULLFILE^cywapi("R",routine,filename,"D")
Goto main

10. Example: CyberBus Exchanging Data with MS Excel The following M routine is part of your CyberWin! distribution.

cydemex ;(c) Copyright CyberTools, Inc. 1988 - 2001
; use excel
D:'$D(cu) ^cyu
I $P(cu("zz"),"^",3)'="M" Q ;requires a Microsoft device
S program=expath_"EXCEL.EXE"
S tab=$C(9) ; delimiter for EXCEL
; build global
S ^tmp($J,0)="FAMILY"_tab_"DOGS"_tab_"CATS"_tab_
F i=1:1:1000 S ^tmp($J,i)=i_tab_$R(3)_tab_$R(5)_tab_$R(4)_
; send file
D PUSHFILE^cywapi("M","^tmp("_$J_")",file)
; import to excel
D LAUNCH^cywapi(program,file,"")
K ^tmp($J)

Back to the Top

• Uniquely Powerful Functionality reduces development time & time to market.
• Portability. Our "Build-it-Once" design means that a single development effort covers all your platforms, so it's easy to simultaneously release products for multiple industry-standard GUIs, character terminals and all M implementations.
• Our Commitment to Intelligent Design. CyberTools is 100% ANSI and native code, for superior speed and reliability. We keep up with GUI advances, designing for 100% update compatibility to promote a longer life cycle for your application.
• No Imposing Coding Methodology. You use M the way you always have.
• WYSIWYG Visual Development Environment: no complex proprietary API code.

Programmer Productivity
• Visual Development Environment (VDE): WYSIWYG, interactive testing, multi-lined text fields, text fields, table/dictionary fields (multiples, multiple selections from pop-up, filtering, mapping, key word lookup, etc.), radio buttons, check boxes, push buttons, scroll bars, unlimited windowing, multiple national languages, object-action (e.g., CUA) or action-object
• Ports to GUIs unmodified
• Build true object-oriented applications
• List pop-ups
• Text box pop-ups
• Style library
• CASE code generation
• Hypertext: on-line, hardcopy, multi-lingual
• High level debugger
• Optional object-oriented Data Dictionary

User Benefits
•Attractive applications
• High performance: applications actually run FASTER!
• Easy to use
• Function keys and mouse
• Unlimited windows: branch to other applications
• Applications are event-driven with object-oriented behavior.
• Code-to-text and boilerplate libraries
• Hypertext, keyword searchable HELP
• Word processing-style editing
• CyberTools' rock-solid product integrity

Back to the Top

CyberTools Object Library
The CyberTools Object Library is an object repository for the CyberTools User Interface Management System. It synchronizes object use in CyberTools windows, documents your system, and integrates with other popular M tools, such as FileMan and KBSQL. Any object utilized in a CyberTools window can have its attributes extended but protected, a powerful implementation of the object-oriented paradigm.

Actively Declares Your Database for Use With Any CyberTools Developer: (CyberM, CyberWin!, CyberJ). Can also be used stand-alone to document databases and provide dictionary-to-dictionary translation capabilities.

Document Your Database: displays one, many, or all of your database files in an image format. Includes the length of the data at each node to help you manage string length.

Rapid Application Development: develop in CyberTools, then log your fields back in the Object Library automatically. Your prototype is thus preserved in the Object Library which you then use for managing consistency without slowing your development.

Dynamic Debugging: insert executable M code into every area of the field definition. Debug any code: a window opens, you test your code interactively, refine it, then re-insert it into the field definition.

National Language Support: The Object Library supports multiple national languages, maintaining names and documentation for each language.

Portable: written in the CyberTools UIMS, the Object Library works on any device, with any M.

Enforce Consistency in Your Database: if you change the Object Library, the CyberTools developer(s) and any alternate data dictionaries you're using are updated automatically.

Link Management: enforce consistency between data dictionaries/object libraries automatically at the time of changes or record changes on a list for a later consistency updates. Compare Object Library entries with those in alternate dictionaries/object libraries to verify whether changes were made directly to the alternates. In case of discrepancy, you can then update the Object Library from the alternate dictionary.

Protect Custom Fields: if a CyberTools developer field has been altered from the original Object Library version, you can preserve the changes in CyberM and other CyberTools developers.

Custom Data Types: comprehensive library functions include create/edit data type and associated transformations and validations. When you define a field as having a particular data type, it inherits all these transformations and validations.

Back to the Top

Home | About M/Caché Tools | About CyberTools for Libraries | About Us | Contact Us