Turing Logo  

Designed for computer science instruction, Turing is simply the easiest, most fun, and most effective way of teaching programming concepts.


Quick Links
Home page of Holt Software Associates  | Home page of the Turing Programming Language, the fastest way to teach programming concepts  | Home page of Holt Software's Java products  | Home page of Ready to Program with Java(tm) Technology, a Java development environment designed for education  | Information about Holt Software's courses for teachers  | Information about how to contact Holt Software  | Information about how students can purchase Holt Software's books and software  | Information about how schools and bookstores can purchase Holt Software's books and software

Turing Technical Information


This document is a collection of technical information about the Turing Programming Language. For information about non-technical issues such as product naming, licensing and distribution, click here.

This document is structured as an index to a series of technical articles, followed by an index to Turing documentation followed by questions and answers.

Technical Articles
Documentation
Technical Questions


Technical Articles

Documentation

All of these documents are in Adobe Acrobat (PDF) format. If you have Adobe Acrobat Reader installed, then click on the links below. If you do not have Acrobat Reader, then you can obtain it free of charge by clicking the Get Acrobat Reader icon.

Get Acrobat Reader

Technical Questions -

Files
Strings
Graphics
Memory
Printer
Misc
Holt Software


Files

  1. How do I redirect only part of my input/output to come from the keyboard/screen?
  2. How do I append to a file?
  3. What's the difference between an ASCII file and a binary file?
  4. Why use binary files at all?
  5. When I type or edit a binary file, why can I see strings that I wrote out to it?
  6. How do I go to the n-th record in a binary file?
  7. When do I use get skip?
  8. How do I truncate a file?
  9. How do I delete a record in the middle of a binary file?
  10. Why do I get "Illegal extended character in string literal" in my open statement?
  11. Why do I get the error "<operation> attempted on incompatible stream number 0"?

Strings

  1. How do I set the n-th character of a string to a particular letter?
  2. How do I delete from the i-th to the j-th character in a string?
  3. How do I enter a string for input with spaces in it without putting it in quotes?
  4. How do I read an entire line of input into a string?
  5. How do I put a backslash (\) into a string constant?

Graphics

  1. [Classic Turing] How do I make text blink?
  2. Why isn't my text blinking?
  3. [Classic Turing] How do I put text in graphics mode on a non-black background?
  4. [Classic Turing] How do I stop put from erasing the graphics underneath the text?
  5. [Classic Turing] How does colourback work in graphics mode?
  6. [Classic Turing] How can I display a PCX/GIF/TIFF file in Turing?

Memory

  1. How long is an integer? real? boolean? string?
  2. How long is a record?
  3. [Classic Turing] What is a "stack overflow during dynamic array allocation" mean?
  4. [Classic Turing] What is "subprogram calls nested too deeply. (Probable cause...)" mean?
  5. [Classic Turing] What is the stack and how do I increase its size?
  6. [Classic Turing] What does a {manifest, code, global} table overflow mean?
  7. What is a collection? How does it work?

Printer

  1. How do I send my output directly to the printer?
  2. How do I send part of my output directly to the printer?
  3. How do I send graphics output to the printer?
  4. Why don't my locate commands show up on the printer?

Miscellaneous

  1. Are there illegal values for integers and strings in Turing?

Holt Software

  1. What is Holt Software's presence on the internet?

How do I redirect only part of my input/output to come from the keyboard/screen?
You can't. If you wish to sometimes read from the keyboard and sometimes read from a file, or sometimes write to the screen and sometimes write to a file, you need to use file I/O. This means using the open and close statements. However, in Turing, this is not very difficult. You can find more information about it in chapter 9 of the Turing Tutorial Guide, chapter 12 of Introduction to Programming in Turing and under open, get, put and close in the Turing Reference Manual.

To open a file in Turing, you use the open statement. This statement associates an integer variables with a file. In this way, you can have multiple files open at once, each with its own variable to refer to it. The open statement has the form:

open: fileNumber, fileName, capability {,capability}

fileNumber fileNumber is an integer variable declared before the open statement. fileNumber is assigned a value by the open statement. If the open is unsuccessful (for example, if it couldn't find the file to open when opening for get), then fileNumber is assigned a value of zero or a negative number, otherwise it is assigned a value that will refer to the file opened. In general, the name of the variable should in some way reflect the file being opened.
fileName fileName is the name of the file to be opened. If it is the actual name, then it must be enclosed in quotes like any other string. fileName can also be a string variable. You can specify a complete pathname with disk and directory path in the file name. Note that under MS-DOS, you must use a double backslash (\\) for backslash (\) in the file name because backslash is a special character. (See Why do I get "Illegal extended character in string literal" in my open statement? for more information.
capability this is one of : read, write, put, get, seek or mod.
read & write used to read or write binary data to the file. Essentially, these capabilities allow the program to use the read & write statements on the file.
put & get used to read or write text data to the file. Like read & write, they allow the use of put & get statements by the program.
seek allows the use of the seek and tell statements on the file.
mod tells Turing not to erase the file if it is opened for output. Normally, a file opened for put or write is created if it doesn't exist or erased and created again if it does. mod prevents the file from being erased.

Here is an example program that opens the file "TEST" in the root directory of the C: drive (on an MS-DOS system) and puts the words "Hello, world" in it.

            var myFile: int
            open: myFile, "C:\\TEST", put
            put: myFile, "Hello, World!"
      

Note that to put to the file (as opposed to the screen), you add ": streamNumber" just after the put. This tells the program to write what follows to the file instead of the screen. You can put to the file exactly what you would put to the screen. To do get's from a file, you use the same method. You open the file for get and then issue "get : streamNumber, variable, ..." instructions which will read from the file instead of the keyboard.

When you are finished with a file, you should close it. This is done automatically by Turing at the end of each run, but it's good practise to close the file in your program. To close a file, you use "close : streamNumber". At that point, you can't access the file any further without opening the file again.

Note that if you open a file for put or write, the file is created if it doesn't exist and erased if it already exists. If you wish to open the file for put or write and not have the file erased, you must add mod to the list of ioCapabilities. See How do I append to a file? for more information.

How do I append to a file?
To append to a file in Turing, you need to open the file for put (or for write if it was a binary file) and also add seek and mod to the capability list (the capability list is the list of actions that you place after the file name in the open statement). Then you do a seek to the end of file. After that, anything you put or write will be added to the end of the file. Here's an example of appending to a file:

            var fileNumber: int
            open: fileNumber, "test", put, seek, mod
            seek: fileNumber, *             % seek to eof
            put: fileNumber, "Hello"
      
Note that the seek action is added to the capability list in order to allow you to seek to the end of the file. The mod is added in order to allow you to modify the file. By default, when you open a file for put or write, Turing erases the file if it already exists. Adding mod ensures that this doesn't happen.

What's the difference between an ASCII file and a binary file?
First, let us look at the difference between the binary representation of an integer and the ASCII representation. In a binary representation, which is what the computer uses internally, the number is stored in base-2. An integer is 4 bytes long, so for example, the number 123,456,789 would be stored as 111010110111100110100010101. This is grouped in bytes to form 07 56 CD 15. Unfortunately, that sequence of bytes can't easily be read by a human. Thus to put into a form that humans can read, we use the ASCII equivalent of the number. That is a string with the value "123456789". Using ASCII, the character "1" is represented by the byte 31. Likewise the character "2" has the value 32. Thus the number 123,456,789 would be expressed as 31 32 33 34 35 36 37 38 39 in ASCII.

A binary file is a file that contains the binary representation of its contents. An ASCII file is one that contains the ASCII representation of its contents. In other words, if you did a put : stream, 123456789, the file would contain the bytes 31 32 33 34 35 36 37 38 39 while if you did a write: stream, 123456789, the file would contain the bytes 07 56 CD 15. If you attempt to type the contents of a binary file on the screen, you get all sorts of weird characters, as the computer attempts to display the characters have the ASCII values found in the file. (In our example, byte 07 will be displayed as a "", byte 56 is "V", byte CD is a "Í" and byte 15 is a "". Displaying the ASCII file would display "123456789".)

While it might seem that binary files are much harder to use than ASCII files (for example you can't display the contents of a file to see if you wrote it out correctly), binary files have some very useful properties. The main one is that each data type takes a fixed amount of space. In ASCII, an integer could take as little as one byte (the number "4" for example requires only one byte to represent it, 34) to as many as 10 bytes (the number "-123456789" takes 10 bytes to hold its ASCII representation 2D 31 32 33 34 35 36 37 38 39). A integer expressed in binary form always takes 4 bytes, no matter what the value. Likewise a real number always takes 8 bytes and a string always takes the same number of bytes depending on its declared length.

The second advantage is that binary files are faster to read and write. The computer uses the binary representations internally. When it reads or writes an ASCII file, it is required to convert from the internal binary form to the ASCII equivalent or back. When reading or writing a binary file, no such conversion is done.

Why use binary files at all?
The main advantage to using binary files is that in a binary file, each data type always takes the same number of bytes. An integer always takes 4 bytes, a real always takes 8 bytes, etc. This means that unlike an ASCII file, it is possible to immediately jump to an arbitrary record in a file. If the file contains 10,000 integers, you can go to the 3,478th integer instantly by knowing that it can be found at the 3,477 * 4 = 13,908th byte in the file. In an ASCII file, the only way to locate the 3,478th integer would be to read all 3,477 integers in before it. In large files (say the phone book), reading all the names before the name you're looking for becomes impossible. In other words, binary files are important when you need to be able to jump to a random record in a file, because you can calculate where that record can be found. This is why random access files and binary files are usually taught together.

You can find more information about these chapter 15 of the Turing Tutorial Guide (Random Access to Record on Disk), chapter 18 of Introduction to Programming in Turing and under open, read, write and close in the Turing Reference Manual.

When I type or edit a binary file, why can I see strings that I wrote out to it?
When you write out a string to a binary file, the string is already in ASCII format. That's how the computer stores strings internally. However, internally, the computer always stores a number of bytes equal to the maximum length of the string plus one. Thus if you declare name to be string (10) and store the name "Thomas" in it, internally the string will look like "Thomas" followed by the byte 0, which indicates the end of the string. As well, there may be extra bytes inserted at the end of the string for alignment purposes. These are extra bytes to ensure that integers and real numbers start on the proper memory addresses. When you use name in your program, the computer knows that the string ends at the "s" because of the 0 byte that follows it. However, when you write it to disk, you will see not only Thomas, but also the 0 byte (which normally looks like a blank).

Thus when typing out a binary file that contains lots of string data, you will see the data followed by junk characters that could be parts of old strings, or uninitialized values or almost anything else. When the computer reads the data file, it will know that the 0 byte signifies that the string actually ends at the right place.

How do I go to the n-th record in a binary file?
The seek statement in Turing allows you to set the file pointer to an arbitrary byte in the file. In other words, doing a:

seek : stream, 25

moves the file pointer to the 25th byte in the file. To move to the n-th record in a file, you need to know the record size. Then you do a:

seek : stream, (n - 1) * recordSize

Note that you use (n - 1) instead of n because the first record of the file starts at position 0 (i.e. the beginning of the file).

You can get the record size of the file in one of two ways. Either you can get Turing to tell you the record size, or you can determine the value experimentally.

To get Turing to tell you the size, you use the sizeof function. This function returns the size (in bytes) that a record (either type or variable) takes. Here is an example to find out the size of the rec record.

            type rec :
                record
                    name : string (20)
                    address : string (40)
                    age : int
                    salary : real
                    married : boolean
                end record

            put sizeof (rec)
      

To determine the value experimentally, use the following program:

            type rec = record
                            ... rest of record here ... 
                        end record
            var stream, size : int
            var data : rec

            open : stream, "junk", write, seek
            write : stream, data
            tell : stream, size
            close : stream
            put "Record size = ", size
      
This program writes a single record at the beginning of a new file and then uses the tell statement to return the current position, which is also the size of a single record. Note that the file is opened for write so that you can do a binary write to the file and for seek so that you can do a tell on the file.

When do I use get skip?
In general you will need to use get skip rarely. Turing was modified a number of years ago so as to greatly reduce the number of times this is necessary. First of all, you need to know that get skip merely reads over any white space in a file. In general, you will only need it when you are doing input of fixed number of characters. In those cases, you will usually want a get skip to skip over the new line character before either checking for end of file or reading in another record. Usually you will use it as follows:

get name : 24, address : 40, phone : 8, skip

After reading in the 76 characters on the line, the file pointer is probably pointing to just before the new line character. Without the skip, if the program checks for end of file, it will always return false, (since the file pointer is not pointing at the end of file), and if you do another read, the first character that will be read into the name field will be a new line, which is not what is wanted at all. By using the skip, the program will read over the newline and be pointing at the beginning of the next line.

How do I truncate a file?
Unfortunately, there is no mechanism in Turing do truncate a file. In order to shorten a file, you must open a second file and then do a record-by-record read from the first file and write to the second file. When you have reached the point where you want the file to be truncated, stop writing to the second file.

How do I delete a record in the middle of a binary file?
Unfortunately, there is no mechanism in Turing do this directly. (In fact, there is no mechanism to do this directly in just about any general purpose language.) There are generally two methods you can use to get around this.

One, when you want to delete a certain record, you can "zero" out the record in some manner. This is often accomplished by setting the key field to "empty" or something of this nature. When a record with a name field of "empty" is read the program knows that the record is no longer in use. Every so often you should go through the file to get rid of the "holes" (that is the "zeroed" out records) in the file. You do this by opening a second file and then doing a record-by-record read from the first file and write to the second file. Whenever you read a "zeroed" out record in the first file, you skip over it and don't write anything in the second file. At the end, the second file won't have any "holes" in it.

Two, if order is not important, whenever you want to delete a record in the middle of the file, you can instead copy the last record in the file over top of the record you want to delete and then "zero" out the last record. Later you can truncate the file as per How do I truncate a file.

Note in either of these methods, if you add records to the file you should write new records over "zeroed" out records and then only append to the file if there are no more "zeroed" out records. This saves disk space.

Why do I get "Illegal extended character in string literal" in my open statement?
You are probably using MS-DOS and trying to open a full pathname. In MS-DOS, the directory specifier is a backslash (\). However, in Turing, as in C, the backslash is a special character. For example \n is a newline, \t a tab, \f a formfeed, etc. In order to specify a backslash in a string, you must use a double backslash (\\). For example, to open "C:\TEST\TPROGS\MYTEST.T" for get, you would use the statement:

open : stream, "C:\\TEST\\TPROGS\\MYTEST.T", get

Why do I get the error "<operation> attempted on incompatible stream number 0"?
If an open fails in Turing, the stream number is assigned the value of zero. If you attempt to do a get, read or write from stream zero, you will get the above error message. It is almost always a good thing to check to make certain that the stream number is positive after an open statement and print an error message if the file was not successfully opened. Note that you can actually put to stream zero. Stream zero is the screen. This means that if you open a file for put and the open fails and you don't check for it, then any puts you make to the file will be sent to the screen instead. Once again, it's a good idea to check for a successful open by making certain that the stream number returned is positive.

How do I set the n-th character of a string to a particular letter?
There is no way to directly assign to a substring in Turing. You change a character in a string by rebuilding the string. To change the n-th character in string s to "x", you would write:

s := s (1 .. n - 1) + "x" + s (n + 1 .. *)

How do I delete from the i-th to the j-th character in a string?
There is no way to do directly delete a substring in Turing. You delete a substring by rebuilding the string. To cdelete from the i-th to the j-th character in a string, you would write:

s := s (1 .. i - 1) + s (j + 1 .. *)

How do I enter a string for input with spaces in it without putting it in quotes?
You need to switch to line-oriented input. You do this by adding ": *" to the end of the get of the string. The program will then read an entire line of input including spaces, quote marks and anything else and assign it to the string.

            var line : string
            get line : *  % Read an entire line of input into line
      
Note that there is no way to be able to enter (for example) a full name and an age on the same line. Turing has no way of knowing where the full name would end and the age begin. Thus you can either read a single token or an entire line. (You can also read in a fixed number of characters, but that's rarely useful in keyboard input.

How do I read an entire line of input into a string?
See How do I enter a string for input with spaces in it without putting it in quotes?

How do I put a backslash (\) into a string constant?
In Turing, as in C, the backslash is a special character. For example \n is a newline, \t a tab, \f a formfeed, etc. In order to specify a backslash in a string, you must use a double backslash (\\). For example, to assign the string "Forward slash = / and backslash = \" to the variable s, you would use the statement:

var s : string := "Forward slash = / and backslash = \\"

[Classic Turing] How do I make text blink?
Unfortunately, there is no simple way of doing so under Microsoft Windows or the Apple Macintosh. "Classic Turing" for DOS allowed for blinking text only in screen mode (not graphics mode). You did this by specifiying a colour in the colour procedure of greater than 15. The actual colour is set to 16 - the colour specified.

            colour (4)          % The colour is set to red
            put "Red"
            colour (20)         % The colour is set to blinking red
            put "Blinking Red"
            colour (12)         % The colour is set to bright red
            put "Red"
            colour (28)         % The colour is set to blinking bright red
            put "Red"
      

Why isn't my text blinking?
Probably because you are either using WinOOT 3.1.1, Turing 4.0, an Apple Macintosh or, if you are using Turing for DOS, you arein graphics mode.

[Classic Turing] How do I put text in graphics mode on a non-black background?
Unfortunately, not easily. In graphics mode, the IBM PC places text on a background of colour 0 (which is by default black). There is no way of circumventing that at this time. However, you can change the value of colour 0. The cost is (1) you won't be able to display black, and (2) all text on the screen will have to have the same background colour. If that is acceptable, you can then use the following as an example:

        setscreen ("graphics:vga")
        drawfillbox (0, 0, maxx, maxy, 12) % Fill screen with bright red
        colourback (5)                     % Set the background colour to purple
        locate (10, 10)
        put "Hello" ..                     % Puts Hello on a purple background
      
Note that if you have Turing 7.1 or greater, you can set another colour to represent black using the setcolour procedure.

[Classic Turing] How do I stop put from erasing the graphics underneath the text?
You can't. However, if you put ".." (dot dot) after the put statement, that does stop Turing from erasing to the end of line.

[Classic Turing] How does colourback work in graphics mode?
Normally, any pixel that is colour 0 on the screen is displayed in black. The colourback command changes the value of colour 0, so that instead of displaying black, it displays the same colour as the colour number you specified. Note that this means that unless there is another colour number that is also black, you don't have black available to you anymore. When you switch the screen to graphics mode, every pixel on the screen is colour 0. When you do a colourback, all pixels of colour 0 immediately transform to the specified colour, thus seemingly changing the background colour. Note that if you don't have any pixels of colour 0 visible, then you won't see any change.

The other part where colour 0 is found is that whenever a put is done in graphics mode, the letters are automatically surrounded by a block in colour 0. (This is done by the IBM BIOS, so there's no easy work around.) This means that if you've done a colourback, then any text will be surrounded by the colour specified in the colourback command.

[Classic Turing] How can I display a PCX/GIF/TIFF file in Turing?
PC-Turing can only read PCX files. However, there are a number of public domain utilities that will convert from one file format to another. Also, MS Windows comes with a Paint program that also can read in a number of file formats and sabe the results as PCX. If you are using PC-Turing 7.2, you use PCX2TM2.EXE and then use the Turing program SCRNFL2.T. Both are provided with all Turing distributions.

First from the DOS prompt, run PCX2TM2 file.pcx. This will display the graphics file and save it as file.tm2, which Turing can read. Then in your main program, include SCRNFL2.T and make a call to FileToScreen. FileToScreen has the following definition.

FileToScreen (x, y : int, filename : string)

You can find example programs that demonstrate this in the EXAMPLES/PCX directory that comes with Turing.

How long is an integer? real? boolean? string?
In Turing, an integer(int) is always 4 bytes long. A real is always 8 bytes long. A boolean is always 1 byte long. A string without a length specified is 256 bytes long. A string with a length specified (say of length n) is n + 1 bytes long.

For example, a string (1) takes 2 bytes. A string (4) takes 5 bytes.

How long is a record?
Unfortunately, you it's not easy to determine the size of a record, as extra bytes may be added for alignment purposes. There are two techniques, both listed in the middle of How do I go to the n-th record in a binary file?

[Classic Turing] What is a "stack overflow during dynamic array allocation" mean?
Turing allocates either a 32K or 64K stack to hold temporary variables such a local variables in procedures and dynamic arrays. The error means that in attempting to allocate space on the stack for the array, Turing ran out of stack space. It's often vary useful to calculate the size of the array to check how larg it is. The array takes (# of elements X size of data type) to store. For example, and array of 1200 integers takes 4800 bytes.

This error most often appears in conjunction with dynamic arrays of strings, or even more commonly, when declaring an array using sizepic for a takepic buffer. Try printing out the value of the sizepic call to get an idea of how large an array you're trying to declare. A full VGA screen is 150K, well over the maximum 64K for the stack.

[Classic Turing] What is "subprogram calls nested too deeply. (Probable cause...)" mean?
This could more accurately be called Stack Overflow. It means one of two things. (1) You actually have infinite recursion, meaning that a routine is calling itself, which calls itself, which calls itself, etc. Every time through the loop, some of the stack is used.

More often, it means that the routine just called has a large number of local variables, which won't fit on the stack. Calculate the rough size of the local variables. As always, largs arrays (especially of strings) are often the culprit.

[Classic Turing] What is the stack and how do I increase its size?
The stack is the area located to hold temporary variables, such as local variables in procedures and dynamic arrays. In PC-Turing, it defaults to 32K. Under MacTuring, Icon Turing and any TCOMP'd program, the stack is set to 64K. To increase this size under PC Turing, start Turing up with the "-stack=" option. i.e. to set the stack to its maximum size, you would use:

turing -stack=64

To make matters a little more complicated, the stack doesn't necessarily get set to the stack size specified. What happens is that Turing tries to allocate that amount of space. If there's not enough memory, then Turing decreases the amount asked for by 2K and then tries to allocate that. It continues to decrease it until it reaches a minimum of 10K or so. Thus it is possible to have a 10K strack, even when you've specified 64K.

You can determine how much stack was allocated to a program by selecting the Run Info menu item from the Run menu after a program has been run. The dialog box displays that maximum amount of stack it tried to allocate and the actual amount of stack that was allocated.

[Classic Turing] What does a {manifest, code, global} table overflow mean?
The answer for this question is quite involved. Please read the section titled Writing Large Program in Turing in Chapter 3 of the Turing Reference Manual. This contains a complete list of all the memory errors and methods of working around them.

What is a collection? How does it work?
A collection is one way that Turing implements pointers. You can use collections to allocate an arbitrary number of blocks of memory (subject only to the limitation of the total amount of memory available to Turing).

However, in order to make pointers easier to use, Turing conceptually structures them like arrays, except arrays where you have to allocate each element individually. While there is not enough space for a complete explanation of pointers, here's a small explained example:

            var list : collection of
                    record
                            name : string
                            next : pointer to list
                    end record

            var first : pointer to list
            new list, first
            list (first).name := "Tom"
      
This defines list to be a collection. Note that list does not actually take up any memory. first is declared to be a pointer to list, but it doesn't actually point to anything until the next line. The new command actually creates an element of the collection. It makes first point to the memory just allocated. The last line shows how you assign to an element of the collection. Notice that the collection is treated like an array name with the pointer being an index into the array. For more information check the Turing Reference Manual.

How do I send my output directly to the printer?
Under Turing 4.0, you select the Run with Arguments menu item from the Run menu. Then click on the "Printer" or "Screen and Printer" radio button under the "Output To:" heading. Then click on the "Run" button. Note that if you send output to "Printer", rather than "Screen and Printer", you will see no output on the screen until the program finishes execution. Also note that graphics and locate commands are not sent to the printer. The printer can only handle straight text.

How do I send part of my output directly to the printer?
Under Turing 4.0, you send output to the printer just as you would send output to any other file, except that in the open statement, you use the filename "printer". Because the printer can only be sent straight ASCII, the printer is almost always opened for ASCII output (i.e. put). Here's an extremely short example of sending the words "This is being sent to the printer instead of the screen" to the printer:

            var printerStream : int
            open : printerStream, "printer", put
            put : printerStream, "This is being sent to the printer instead of the screen"
            put "This is being sent to the screen and not the printer"
            close : printerStream
      
If you are familiar with the escape sequences of your particular printer, you can send them to the printer by doing a put : stream, char (asciiCode) .. to send a particular ascii code. Note that Turing can't use characters 0 or 128, so you won't be able to send those characters (See Are there illegal values for character, integers and strings in Turing?).

Note that this method does not currently work for MacTuring. It does work for MacOOT.

How do I send graphics output to the printer?
You can't send graphics from within a Turing program at this time.

Why don't my locate commands show up on the printer?
The printer doesn't have the ability to move the print head around arbitrarily. Thus a printer can only be sent straight text. If you have multiple locate commands in the program and the output is sent to the printer, the the printer will only print the text from the put statements and the locate commands will change the cursor position on the screen.

Are there illegal values for integers and strings in Turing?
Yes. Turing uses certain values in order to signify that the variable is uninitialized. If you try to use an uninitialized value, you get an error indicating this. The uninitialized value string is, in hexadecimal, 0x8000000. This corresponds to the integer -2147483648. Note that if you are reading in an array of integers from a binary file (or from the contents of a takepic buffer), you could have this value stored in a variable. If you attempt to use it or print it out, you will get an uninitialized value error. About the only thing you can do is do a binary write of the variable.

As for strings, the hex values 0x80 and 0x00 are illegal for the same reason. You can't read in either by a getch or using the chr function a character with a value of either 0 or 128.

What is Holt Software's presence on the internet?
Holt Software's web site can be found at

http://www.holtsoft.com

Technical support questions can be e-mailed to west@hsa.on.ca. Questions involving sales can directed to chris@hsa.on.ca.


[ Turing Home ] * [ Top of Page ] * [ Feedback ]