Skip to main content

Frequently Asked Questions About Studio

A Question and Answer Set about Studio.

Projects

Question:

What is a project?

Answer:

A project is a collection of class definitions, routines, and/or CSP files that you can group together for the sake of convenience.

Using projects gives you an easy way to return to your work when you start a Studio session. For example, you can place all the classes related to an application, or part of an application, in a project. When you start Studio, open this project and the Project tab of the Workspace window displays all the classes in a convenient list.

You can also export and import entire projects to and from a single external file making it easy to save or pass around application code.

Question:

How do I add an item to a project?

Answer:

Here are some of the ways to add items to a the current project:

  • Before opening one or more items (with File > Open), select the Add to Project check box in the Open dialog.

  • To add the item in the current editor window to the current project, select Project > Add Item.

  • In the workspace window, highlight an item, right-click, and select Add to Project.

Question:

Can I add something from another namespace to my project?

Answer:

No. A project can only contain items that are visible to the current Caché namespace.

Question:

Can an item belong to multiple projects?

Answer:

Yes. A project is a specified set of items (class definitions, routines, and CSP files) that you choose to group together. The items themselves have no link back to the projects they may belong to. There is no limit to how many projects an item can belong to.

Question:

What if I don't want to use projects?

Answer:

You are not required to use projects with Studio; you can completely ignore them if you like. To ignore projects, do not add any items to the default project and ignore the prompt asking you if you want to save your project when you exit Studio.

Question:

Can I export a project?

Answer:

Yes. Select Tools > Export > Export Project. Enter a file name and press OK. This exports the entire contents of the current project (including the project definition) to a single XML file.

Question:

How do I delete a project?

Answer:

Select File > Open to list all your projects. Right-click a project and select Delete.

Note that you can use File > Open to delete any type of item on the server in this way.

Opening Files

Question:

How do I open a class definition?

Answer:

To open an existing class definition (that is, one saved on the Caché server), do the following:

  1. Make sure you are connected to the Caché namespace and server containing the class definition.

  2. Select File > Open.

  3. In the Open dialog, make sure that class definitions are listed by selecting Class Definitions (.CLS) or All in the File Types combo box.

  4. Package names are listed in the file list as folders. Select a package name to list all the classes (or subpackages) within the package. Double-click a class name to open it.

  5. Alternatively, you can enter the name of the class you want directly into the filename edit box with a .cls extension (such as Sample.Person.cls) and select Open.

Question:

How do I open a routine?

Answer:

To open an existing routine (that is, one saved in the Caché server), do the following:

  1. Make sure you are connected to the Caché namespace and server containing the routine.

  2. Select File > Open.

  3. In the Open dialog, make sure that routines are listed by selecting either MAC routines (.MAC), INT routines (.INT), or All in the File Types combo box. Double-click a routine name.

  4. Alternatively, you can enter a routine name with extension directly into the filename edit box (such as MyRoutine.MAC) and select Open.

Question:

How do I open a CSP file?

Answer:

You can open a CSP file in the same way that you open a class definition or a routine. The main difference is that the Open dialog lists CSP Applications (for example, /csp/samples) as folders; select the name of an application to see the CSP pages within it.

Question:

What does the Show System check box in the Open dialog do?

Answer:

If the Show System check box is selected, then the File > Open dialog lists system items (items whose names start with the % character and are stored in the CACHELIB database) along with items in the current namespace.

Question:

Can I use pattern matching in the File > Open dialog?

Answer:

Yes. You can use the “*” character as a wildcard to match any number of any character as you can in a standard File > Open dialog. You can use file extensions to filter certain items; for example, “*.cls” lists all Class Definitions in the selected package. You can use the “?” character to match any character. Note that these are Windows pattern matching conventions, not Caché pattern matching.

Question:

How do I open a routine from a different namespace?

Answer:

The Studio File > Open dialog lists items from only the current namespace and server. To open a routine from a different namespace or server:

  1. Select File > Change Namespace.

  2. Open the desired routine.

Question:

Can I open a % class?

Answer:

Yes. You can list % classes (classes whose package name starts with a % character and are stored within the CACHELIB database) from the File > Open dialog by selecting the Show System check box at the bottom.

Studio opens % classes as read-only if you open them while connected to a namespace other than %SYS.

Question:

What does File > Connect do?

Answer:

Studio maintains a connection to a specific Caché namespace and server. It uses this connection to provide a list of classes (such as for specifying property types, super classes, etc.). It also uses this connection for debugging. File > Connect lets you connect to a different server.

Debugging

Question:

How do I start the debugger?

Answer:

You can connect the debugger to a target process in of the following ways:

  • Define a “debugging target” (name of program or routine to debug) for the current project with Project > Settings. Then select Debug > Go to start the target program and connect to its server process.

  • Select Debug > Attach to select from a list of running processes on a Caché server to connect to.

For more details refer to the chapter “Using the Studio Debugger” in this book.

Question:

How can I debug a class?

Answer:

The Studio debugger lets you step through the execution of programs running on a Caché server. These programs can include INT files, MAC files, methods within CLS files, CSP classes responding to HTTP requests, server-side methods invoked from Java or ActiveX clients, or server-hosted applications.

  1. To view the INT file during debugging and to save the INT for further review later, set the Keep Generated Source Code option before you compile your class, located on the Tools > Options > Compiler > General Flags page.

  2. Set a breakpoint at the desired location in a class method (or any of the other files mentioned above) by pressing F9 (toggles breakpoint) on the desired source line.

  3. Set a debug target to specify where you want the debugger to begin code execution using Debug > Debug Target. Enter the name of the class and the method that you want to step through.

  4. Start the debugger with Ctrl+F5 or Debug > Go.

Question:

Can I watch variables?

Answer:

Yes. While debugging, enter a variable name (or an expression) in the left-hand column of the Studio Watch Window. Each time the debugger pauses, the variable or expression is reevaluated.

Editing

Question:

What do the different colors in the editor mean? Can I change the colors in the editor?

Answer:

The Studio uses colors to differentiate the syntax elements of a given language.

You can change the colors used for the various syntax elements as follows:

  1. Select Tools > Options > Editor > Colors.

  2. Select a language.

  3. Select an element (comment, variable, etc.)—the list of available elements depends on the selected language.

  4. Select Foreground and Background colors andselect OK.

Question:

Why is there a wavy, red line underneath my code?

Answer:

The wavy, red line indicates that the underlined code (or possibly code before it) contains syntax errors.

Question:

Does Studio support Kanji and Chinese characters?

Answer:

Yes. Studio has complete support for Unicode and Kanji characters.

Question:

Does Studio support Hebrew and Arabic characters?

Answer:

Yes. The Studio Editor supports Hebrew and Arabic characters, as well as bidirectional editing.

Importing Files

Question:

Can I import class definitions or routines from external files?

Answer:

Yes. Select Tools > Import.

Question:

What is the difference between Local and Remote files?

Answer:

Studio is a client/server application; the Studio itself runs on a client system and talks to a server. The server can either be on the same machine or on a remote machine. The Studio uses the terms “Local” and “Remote” to refer to operating system files (such as when you are importing or exporting) that are stored on the client and server systems, respectively.

If both the client and server are on the same system then there is no difference between Local and Remote.

Printing

Question:

Can I print from Studio?

Answer:

Yes. Select File > Print or File > Print Preview.

Templates

Question:

What is a Template?

Answer:

Templates are a mechanism for creating user-defined Studio add-ins. A template is a program that enters a code fragment into the current document at the current cursor point. You can customize the code fragment to your needs. See the chapter “Using Studio Templates” in this book for more information.

Question:

Is there a list of available Templates?

Answer:

Yes. Select Tools > Templates > Templates.

Question:

Can I create a new Template?

Answer:

Yes. See the chapter “Using Studio Templates” in this book.

Multiuser Support

Question:

Does Studio support development by multiple users?

Answer:

Yes. You can do this in several ways:

  • Set up a common Caché server system and have all developers store their code on it.

  • Use local Caché servers (on the developer's system) and store source code in a source control system as exported XML files.

Question:

What happens if I try to open a class (or routine) that someone else is editing?

Answer:

Studio displays a dialog stating that the class (or routine) is in use by someone else and asks you if you want to open it in read-only mode.

Question:

What if someone wants to edit a super class of a class that I am working on?

Answer:

Studio does not prevent another developer from modifying the super class of a class you are working on.

While Studio could take out locks on all subclasses whenever a class is opened for editing, in practice this would be annoying and unwieldy. Instead, a development team needs to work out rules and procedures for defining and modifying super classes. This is similar to how development teams in other languages (say Java) usually work with class definitions in source control systems.

Classes

Question:

How do I create a new class?

Answer:

Use the New command in the File menu and ask for a new Class Definition. This invokes the New Class Wizard.

For more details, see the chapter Class Definitions in this book.

Question:

Can I see the source code generated for my class?

Answer:

Yes. You can see all the source code generated by the Class Compiler with View > View Other Code (available when the current window contains a class definition).

Make sure that the Keep Generated Source Code option is set before you compile your class. This option is located on the Tools > Options > Compiler > General Flags page.

Question:

When I try to compile my class, the Studio says it is up to date and does not need to be compiled. Can I force a compile to happen?

Answer:

Yes. Turn off the Skip related up-to-date documents option. This option is located on the Tools > Options > Compiler > General Flags page.

Routines

Question:

How do I create an INT routine?

Answer:

Create a new ObjectScript routine using the New command in the File menu and then save the new routine using a name with a .INT extension. You can create an include (.INC) file in the same fashion.

SQL

Question:

How do I define an SQL View?

Answer:

Studio does not include a mechanism for defining SQL views. To do this, as well as other SQL tasks, use the Management Portal.

Source Control

Question:

Does Studio integrate with external Source Control systems?

Answer:

Yes. The procedure is:

  1. Create a subclass of the system-supplied class %Studio.SourceControl.BaseOpens in a new tab where you implement the methods to interact with your source-control system. The class that you create is called from Studio in response to particular events and then performs the actions that you have specified.

  2. In the Management Portal, navigate to System Administration > Configuration > Additional Settings > Source Control, select the site-specific source-control class from the list, and select OK.

At this point, Studio has been configured to interact with the source-control system. When Studio attempts to open a document, prior to opening it, the OnBeforeLoad method of your source-control class is invoked; typically, this method checks the timestamp on a file representation of the document and, if it is newer in the file, the method calls a Caché function to import this into the current namespace. This makes sure that the user is seeing the most up-to-date version of the file.

If you modify the file and save it, then Studio calls the OnAfterSave method of the source-control class, which typically exports this document to the filesystem. (This keeps these files in sync with the routines, classes, etc. that are in Caché.)

When you attempt to modify a document, Studio attempts to get a lock on it, which also triggers a call to a source control method GetStatus. If the file is locked in source control, Studio can then ask if you want to check it out. This triggers a call to the CheckOut method which performs the actions required to check the item out.

%Studio.SourceControl.BaseOpens in a new tab and %Studio.Extension.BaseOpens in a new tab provide a set of methods that allow you to create interactions between Studio and your source-control system that are as simple or complex as you choose.

Question:

Can I create my own hooks?

Answer:

Yes. You can define hooks—code that is executed whenever items are saved to or loaded from the server. For details see the appendix “Using Studio Source Control Hooks”.

Compatibility

Question:

Can I connect a Studio client to any Caché server?

Answer:

A Studio client must be running either the same version of Caché or a higher version than the Caché server that it is connecting to. Example: Caché 2015.1 Studio can connect to a Caché 2015.1 (or earlier version) server. Caché 2014.1 Studio cannot connect to a Caché 2015.1 (or later) server. This applies also to maintenance releases. Example: Caché 2014.1.2 Studio can connect to a Caché 2014.1.1 (or earlier maintenance release or version) server. Caché 2014.1.0 Studio cannot connect to a Caché 2014.1.1 (or later maintenance release or version) server.

Question:

Can I run Studio on Linux?

Answer:

The Studio client only runs on Windows platforms. You can use a Windows-client to talk to any server. You can also use a partition manager, such as VMWARE, to run both Windows and Linux partitions on your development system and run Studio in the Windows partition with Caché running in the Linux partition. The only trick is to configure your networking so that the Windows partition can talk to the Linux partition via TCP/IP. Studio can also run under Windows on an Intel-based Macintosh.

Studio Implementation

Question:

Why doesn't Studio use the licensed components of Microsoft Visual Studio?

Answer:

There are several reasons why we built Studio from the “ground up” instead of licensing or extending Visual Studio:

  • The Studio editor uses advanced parsing technology not available within the Microsoft Studio framework.

  • Microsoft cannot guarantee the compatibility of future versions of Visual Studio.

Question:

Why wasn't the Studio interface developed using Java?

Answer:

At this time, the only way to get acceptable performance for the Studio editor is to use direct calls to the Windows API. While there are syntax-coloring editors developed using Java they do not offer the sophisticated multi-language parsing used by Studio and they typically require very high performance computers for decent performance.

FeedbackOpens in a new tab