Computing: DOS, OS/2 & Windows Programming

Exotic programming languages for DOS: Profan.

"Profan2 is a powerful programming language for Windows 95/98/2000 or NT. With "powerful" we mean, that the language includes rather lots of functions, and is able to well compete with other (more complicate) languages. Especially for beginners, its simple commands make it worth to be given a try".

The paragraph above is a free translation of how they describe Profan 7 on the SelfProfan website. That site, in German, is a tutorial about Profan 7 on Windows; the information about the non-GUI commands and functions should however mostly apply to the DOS version, too.

This tutorial is about the installation of Profan 7 for DOS on FreeDOS. It probably applies to other DOS distributions, too. Profan 7 for DOS can be downloaded from the XProfan website. Be sure, to pick the 32-bit DPMI version (there is also an older 16-bit version available). Important to note that the interface of the included editor, as well as the compiler error messages are in German. The "international" file, available at the download page, is unfortunately for the Windows version, only. There is a help file for DOS available ("Hilfe für PROFAN 7.0 für DOS"); the problem is that is intended to be used with Norton Guide or similar software; I have not yet find a program to open .ng files. You can, however, download the Profan 6.6 user manual (German: "Profan 6.6 Handbuch"). It's not version 7 and it's for Windows, but the download archive containing a reference of the variables, functions and commands available in the DOS version, you can use that manual to view their syntax and usage.

The download archive contains the program's folder structure. Unzipping it on my Windows 10 using 7-Zip failed with an invalid header error message for two of the executables, that were not extracted. Thus, put the .zip file on a floppy diskette and "install" the software by running the commands (supposing the archive is contained on a diskette in drive A:):
    mkdir c:\profan
    a:
    unzip -d c:\profan profdos.zip

The screenshots below show the extraction of the archive (don't worry about the warning messages; the extraction is done correctly) (on the left), and the installation directory with the Profan 7 files (on the right).

Profan 7 on FreeDOS: Unpacking the zip download archive
Profan 7 on FreeDOS: Content of the Profan installation directory

The installation files include an IDE, called rpe70.exe. As I said above, the interface is only available in German. The first time that you start it, you get the message "Optionsdatei konnte nicht gefunden werden" (Options file not found). This is normal; a default options file will automatically be created.

Profan 7 on FreeDOS: First start of the IDE

Each time the IDE is started, a notice is displayed. It tells us that the actual program is the freeware version of the RGH-Profan-Editor. It may be freely used, copied, and distributed, however, not be modified in any way.

For your convenience, here is the English translation of the most important IDE menu commands:

GermanEnglish
DateiFile
NeuNew
ÖffnenOpen
SpeichernSave
EndeExit
 
GermanEnglish
EditierenEdit
KopierenCopy
AusschneidenCut
EinfügenPaste
 
GermanEnglish
ProfanProfan
InterpretierenInterprete
CompilierenCompile
Programm ausführenExecute program

Important to note, that the IDE awaits the Profan executables in the current directory. So, adding the Profan installation directory to the PATH, setting some working directory (with the sources) as current, will not work. When trying to compile a program, you'll get the error message "compile.bat nicht vorhanden" (compile.bat not found). The simplest way to proceed, is to place the sources together with the Profan executables (in my case, in c:\profan).

Here is the code of a simple "Hello user" program. It shows one of these commands, that make life easy for programming beginners: tbox draws a nice box, where you can put your text inside, with one single instruction.
    declare name$, greeting$
    declare x1%, y1%, x2%, y2%
    print "What is your name? ";
    input name$
    cls
    let greeting$ = "Hello", @upper$(name$)
    let greeting$ = @add$(greeting$, "!")
    let x1% = 5
    let x2% = @add(x1%, @len(greeting$))
    let x2% = @add(x2%, 3)
    let y1% = 3
    let y2% = 5
    color 14, 0
    tbox y1%, x1% - y2%, x2%; 1
    locate @add(y1%, 1), @add(x1%, 2)
    print greeting$
    print
    print
    print

Some notes concerning the code:

The screenshot on the left shows the code of hello.prf opened in the IDE editor. The screenshot on the right shows the program execution (after the name has been entered and the screen cleared).

Profan 7 on FreeDOS: Source of a simple 'Hello user' program opened in the IDE editor
Profan 7 on FreeDOS: Execution of a simple 'Hello user' program from the command line

Here is the code of another Profan program. It reads the names of the files of the current directory, and writes them (as full paths) together with the filesizes to a text file. The code shows how to use files in Profan (note the usage of #N as file handle, taken from BASIC, and the commands assign and rewrite taken from Pascal), the special Profan feature of filling a list using the command addfiles, and the system functions @getdir$() and @filesize().
    declare count%, i%, fn$, fs$, s$
    assign #1, "DIRLIST.TXT"
    rewrite #1
    clearlist
    addfiles "*.*"
    let count% = @sub(%getcount, 2)
    print "Number of files in directory: "; count%
    print "Directory listing written to: DIRLIST.TXT"
    let i% = 0
    whilenot @gt(i%, %getcount)
        let fn$ = @listboxitem$(i%)
        ifnot ((@equ$(fn$, "DIRLIST.TXT")) or (@equ$(fn$, "[.]")) or (@equ$(fn$, "[..]")))
            let s$ = @getdir$("@");"\";fn$
            let fs$ = @str$(@filesize(fn$))
            print #1, s$;@space$(30 - @len(s$));@space$(6 - @len(fs$));fs$;" bytes"
        endif
        inc i%
    wend
    close #1

Some notes concerning the code:

The screenshot below shows the first part of the content of the file DIRLIST.TXT, created by my directory listing program, opened in the FreeDOS editor.

Profan 7 on FreeDOS: Directory listing produces by a simple Profan program

The installation files include 3 program examples. The screenshots below show the execution of two of them: On the left, the program patience.prf, a patience card game for one player; on the right, mylldemo.prf, the demo of a "junk removal" game.

Profan 7 on FreeDOS: Execution of the included program patience.prf
Profan 7 on FreeDOS: Execution of the included program mylldemo.prf

Is it possible to run the executables created by the Profan 7 compiler/linker on another DOS machine? Yes, it is. However, you must remember that these executables are 32-bit and need DPMI to run on a standard DOS platform. Thus, if you try to run patience.exe, for example, on MS-DOS 6.22, you will get the error message Load error: No DPMI. The solution is simple: Just copy the file cwsdpmi.exe (included with the Profan 7 installation files) to the MS-DOS directory that contains patience.exe. The program should now run without any problems.


If you find this text helpful, please, support me and this website by signing my guestbook.