Seppo Mustonen : Programming Survo in C

Programming the 32-bit SURVO 98

Technical structure of SURVO 98

The entire SURVO 98 system is programmed in the DOS 32-bit protected mode by using the WATCOM C compiler (ver.11) and the DOS extender DOS/32 Advanced (ver. 5). This technique enables breaking the conventional 640KB barrier of DOS and direct addressing of all the memory of the PC.

SURVO 98 is linked to SURVO 84C by a special 16-bit program which transmits all the necessary information between these two systems. By default, the path of temporary files (tempdisk) is the same for both systems and in this case it is easy to move from SURVO 84C to SURVO 98 and vice versa simply by the ctrl-D key without losing the current status in the edit field. Switching back to SURVO 84C succeeds only if the size of the current edit field is not above the limits of SURVO 84C.

SURVO 98 is located in the W subdirectory of SURVO 84C and in subdirectories of W. Certain parts like the inquiry system are common to them both.

As in SURVO 84C, the center of all activities is the Survo Editor program. When entering SURVO 98 the editor is loaded with the DOS/32 Advanced DOS Extender (Professional Package version 5.00 or later). This extender made by Narech Koumar, Supernar Systems, Intl. is superior among all known DOS extenders.

SURVO 98 also consists of many program modules which are spawned from the editor according to the needs of the user. Both the editor and modules are larger programs for two reasons: a) 32-bit code is typically longer than 16-bit code, b) related actions in SURVO 98 are linked together. For example, the editor itself is a program of almost 220KB (in SURVO 84C 85KB) but it includes very many properties (for example, editorial computing) which were scattered in SURVO 84C in separate modules. This solution consumes less space on the disk and speeds up many functions of Survo. In internal computing SURVO 98 is typically 30 - 200 percent faster.

Thus SURVO 98 is still a modular system like SURVO 84C and it can be extended without any limits with new operations (program modules).

More information on:

Edit fields in SURVO 98

SURVO 98 allows creating and saving of edit fields up to the capacity of the central memory of the computer. For example, in a 32MB memory it is possible to maintain edit fields of 100000 lines with 100 or more columns. The maximum number of columns is 996 but there is no (practical) upper limit for the number of lines. Very large fields are needed only in special applications and temporary situations; for example, when irregular text files (created elsewhere) should be polished. In general, it is not wise to keep big data sets in the edit field.

When an edit field does not exceed the capacity of SURVO 84C (about 60000 bytes), it is saved in SURVO 98 (by the SAVE command) exactly in the same way as in SURVO 84C. Large fields with more than 252 columns and/or too many lines are saved in a new form where only non-empty lines (with their line numbers and possible shadow lines) are stored. Also trailing blanks are omitted and thus much space is spared on the disk. These SURVO 98 edit files are in fact simple text files.

"Over-sized" edit files cannot be used in SURVO 84C as edit fields but they can be treated there as text files (by LOADP and SHOW). An over-sized edit field is indicated by a red square almost at the end of the header line.

Back to the list

Data and matrix files in SURVO 98

Data files have the same structure as in SURVO 84C. Thus all data files (with the .SVO extension) created in SURVO 84C are accepted in SURVO 98.

However, there is one important extension in SURVO 98: In data files with very many fields (variables) SURVO 98 permits long explanations in names of fields. In SURVO 84C the total amount of text in these names and other descriptions of fields is limited to 65500 bytes.

In SURVO 84C the maximum number of elements in a matrix is 8100, i.e. 90x90 is the largest allowed size for a square matrix. In SURVO 98 it is possible to operate with much larger matrices. For example, In a 32MB memory one may handle 1000x1000 matrices by various MAT operations. Again representations are identical in both systems.

Back to the list

Capacity of statistical operations

In typical statistical operations (like LINREG and FACTA) the maximum number of variables in SURVO 84C is at most 90.

In SURVO 98 greatest permitted dimensions are much higher but depend on the size of the central memory. In 32MB no substantial limits will be encountered. For example, factor analysis can be made even with 1000 variables.

Back to the list

Sucros in SURVO 98

Sucros made in SURVO 84C work similarly in SURVO 98. In fact, the regular collections of sucros located in the S and TUT subdirectories of SURVO 84C are used as such in SURVO 98. Assume that the main directory of SURVO 84C is C:\E. When a sucro is activated in SURVO 98, it is searched for in this order:

  1. Current data directory of SURVO 98 (for example, D:\DEMO1)
  2. `sucropath' defined in SURVO.APU of SURVO 98
  3. C:\E\W\S
  4. C:\E\W\TUT
  5. C:\E\S
  6. C:\E\TUT
Observe that the type of Survo can be identified in sucro programs by {save survotype Wi} where Wi gets value 3 in SURVO 98, 1 in SURVO 84C, and 2 in SURVOS.

By the sucro command
/WHICH <name_of_sucro>

the current instance of a sucro is automatically detected.

Back to the list

SURVO 98 in different environments

SURVO 98 works in the common DOS operating system (ver.5+) and in DOS "boxes" of Windows, OS/2, and Linux.

However, the current DPMI (Dos Protected Mode Interface) support is weaker in Windows NT and Linux than in DOS, OS/2, Windows 9x, and Windows 3.xx.

Back to the list

Merits of SURVO 98 when compared to SURVO 84C

Back to the list

Restrictions of SURVO 98 when compared to SURVO 84C

Back to the list

Special system parameters in SURVO.APU

SURVO 98 system parameters are saved as a text file SURVO.APU in its main directory. Thus if SURVO 84C is located in C:\E, the system parameters of SURVO 84C are in C:\E\SURVO.APU and those of SURVO 98 in C:\E\W\SURVO.APU .

All pertinent system parameters of SURVO 84C have the same tasks in SURVO 98. For proper adjustment of SURVO 98 certain additional system parameters are available:

(typically spawn_max=800) tells the number of activations before the SURVO 98 is refreshed by dumping all system parameters (including the edit field, etc.) to disk, exiting SURVO 98 temporarily to SURVO 84C, and returning back to the previous status of SURVO 98. This procedure takes less than one second and it is accomplished automatically.
This precaution is not needed in pure DOS or OS/2 operating systems. In other environments memory space reserved to LDT selectors will be exhausted after certain number of spawns. For example, in Windows 9x and 3.xx this number is little over 1000 but in Windows NT only about 380. In the latter case (NT) spawn_max=200 is recommended.
(currently loudness=<0 or 1000>) gives the volume of sound effects during a SURVO 98 session. loudness=0 means "be quiet!".
s84_warning=<0 or 1>
If s84_warning=1, SURVO 98 gives a warning message if an edit field exceeding the limits of SURVO 84C is saved by SAVE. The field is saved in any case. Value 0 cancels this warning.

Back to the list

Front page of Programming Survo in C