[Develop your Ada program NOW!] [Welcome] [FAQ]

 WebAdaWebAda Tips

Setting a Bookmark

Frame-based, Single Window

No Frames, Single Window

No Frames, Multiple Windows

Consider designing your own interface.

Browser Cache Settings

If the information in the windows is not being updated, you can always Reload that window. Cacheing may be keeping your browser from retrieving the latest WebAda information. In the case of Netscape, the Preferences:Network menu has some Cache settings. Select the Check Documents Everytime setting. Other browsers may have similar settings that will keep your pages up-to-date as you modify code.

The frame version of WebAda tries to coordinate the frames so they are consistent. Keep in mind that each window and frame is a snapshot of what you have stored on the server. This can create confusion if multiple windows are used to edit the same file, because each window will have information about the same file, but at different times.

Copying Programs to WebAda

For most browsers, this is a simple, but not obvious, procedure.

Copy the code using your system's copy or cut operation. It's almost always under an edit menu. Use whatever program shows you the code (Netscape, Eudora, a text editor, etc.) Here's some code to try:

with Ada.Text_IO;

procedure Hello is
Ada.Text_IO.Put_Line ("Hello.");

Go to the Edit form and paste the code in the text area.

Enter a name for the file. Read the FAQ if you are not sure what to name the file. In the example, use "hello.adb".

Finally, save the program.

Reverting to a Previous Version

If you begin editing a program using the edit form and don't like your changes, you can use reset to go back to the original code. However, it also works after you save it. Read these instructions and then try it on the hello.adb program:

  • You attempt to enhance some code and an error message indicates you completely misunderstood what you were doing, but the file has already been saved!
  • If needed, use your browser's "back" operation to go back to the edit window where you made those undesired changes.
  • Hit Reset! Your form now contains the pre-modified code.
  • Save the old version.

There are, in effect, two versions of the code for each edit window: 1) The code read from the server to fill the window and 2) The modified version which is displayed. Then, of course, there is the version on the server; and since you can create multiple edit windows, you could have even more!

If you do not understand what is going on, try this:

  • create a new file with the text "first version" and save (all versions are identical now)
  • edit the text to "second version" (server and reset still have "first version")
  • save (server now has "second version" and reset still has "first version")
  • edit the text to "third version" but don't save (server still has "second version" and reset still has "first version")
  • reset but don't save ("third version" is gone, "first version" is displayed, and the server still has "second version")
  • edit the file (now all versions are identical, "second version")
  • delete the file (nothing left on the server, "second version" still displayed)

If you understand what is going on, then it should make sense to use edit when you want to checkpoint changes you don't want to lose when you hit reset.

Adjusting Font Size

Most browsers are preset with a large font size. This can make some of the code listings too large. Find your browser's preferences and change the font to a size that makes it easy to browse the Ada code and still be easily readable.

Using HTML to Document Your Code

You can put html in comments and WebAda will let you surf them. If you've followed the example so far, Edit hello.adb by adding the following comment on a separate line and compiling (remember how to cut and paste?):

-- <a href="http://archive.adaic.com/compilers/webada/f_tips.html">Go Back to WebAda Tips</a>

Notice that the listing contains the link to come back to this page. It also works when you are surfing the code. And yes, images work, although you will probably want to right align them to avoid interfering with the code alignment:

-- <img src="http://archive.adaic.com/compilers/webada/image/webada.gif" align=right width=100 height=42 border="0" alt="WebAda">

You can combine the link with the image. However, there are line length limits in some tools which you might encounter when trying to keep all of the html in one comment.

Using Quotes for HTML-Like Comments

Code is not treated like HTML, but comments are. So if you wish to put something in the comments that might confuse the browser, surround it with quotes. For example, if you want to indicate the carriage return character as <CR>, then use quotes: "<CR>". Then it won't disappear when the browser thinks it is an unrecognized token:

Ada.Text_IO.Get(Char); -- Check for "<CR>"

Using Multiple Windows

When you are dealing with compiler errors, it helps to see the error messages (and maybe some reference material like the Ada 95 LRM) while you are fixing the errors in the Edit form. Check your browser's help facility if you are unfamiliar with creating multiple windows. After you are comfortable using this feature, you will find it quicker than trying to navigate in one window, even though you may be popping different windows to the front! With Netscape, you can point to a link and then click-hold (for Macintosh) or right-click (for Windows) to bring up the menu with the option to create a new window.

[Develop Program] [Welcome] [FAQ]