The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,173 other subscribers

Archive for the ‘Borland Pascal’ Category

Delphi: playing Chimes.wav as an external file or embedded WAVE resource in Delphi XE5.

Posted by jpluimers on 2018/01/10

As a by-effect, this article seems to one of the few that shows where Delphi uses the .dres file extension introduced around Delphi XE.

Recently I had to play some notification sounds in a Windows Delphi application where the application deployment should be as easy as possible: preferable copying the EXE around.

Playing a sound file seems easy, especially if it is a [WayBackWAV file: just use the [WayBack] PlaySound or the (older) [WayBack] sndPlaySound API functions.

But if you start searching on the internet, you see lots of curious implementations for playing WAV resources through sndPlaySound.

The actual implementation is really really easy though, just make sure you follow the steps right and nothing can go wrong.

[WayBack] The full source code is on my BeSharp.net repository, here is how to to it step by step:

The steps depend on the MMSystem unit, so most of the code translates back to [WayBack] Turbo Pascal for Windows (yes, the 16-bit Pascal days when the MMSystem unit was introduced) with the exception of the SND_SENTRY flag.

The thing that more recent Delphi versions made a lot easier is embedding WAV files as WAVE resources, more on that further on. Read the rest of this entry »

Posted in Borland Pascal, Delphi, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Pascal, Software Development, Turbo Pascal | Leave a Comment »

The Format function introduced in Delphi 1 was based on the FormatStr function in Turbo Vision available in Turbo Pascal 6 or higher

Posted by jpluimers on 2017/10/26

I did find my Borland Pascal 7.0.1 ISO which showed that https://github.com/romiras/turbo-pascal-archive/blob/master/Files/Dos%20Navigator/FORMAT.ASM is identical to ./BP/RTL/TV/FORMAT.ASM which is used from ./BP/RTL/TV/DRIVERS.PAS to provide this:

{ String formatting routines }

{$L FORMAT.OBJ}

procedure FormatStr(var Result: String; const Format: String; var Params);external {FORMAT};

There are various examples like in ./BP/EXAMPLES/DOS/TVDEMO/ASCIITAB.PAS at line 143:

FormatStr(TempStr, ' Char: %c Decimal: %0# Hex: %0#x ', ASCIIChar);

So it was in the Drivers unit, but also easy to incorporate in your own unit by linking the .OBJ file and providing the external declaration in any unit.

The Drivers unit is very independent of the rest of Turbo Vision: it uses the Objects unit (which most projects use as the System unit at ~500 lines of code provided very little functionality by itself).

For the diskette based install, the .TPU files were on the standard disks and the sources for both RTL and Turbo Vision on separate disks, but anyone would install them as they provided a lot of insight. The CD-ROM has them all on the same medium (both as installers and unpacked in the BP directory).

I just checked Turbo Pascal 6.0 (that I did have a VM for) which has them in the same way.

Source: [WayBackWe’re discussing with the collegues: anybody knows when Format function was introduced in Delphi? – Klaus Edelmann – Google+

–jeroen

Posted in Borland Pascal, Delphi, Development, History, Pascal, Software Development, Turbo Pascal | Leave a Comment »

Recursion

Posted by jpluimers on 2016/11/23

Apple fanboys all know about 1 Infinite Loop. Turbo Pascal adepts about the index entries “infinite loop See loop, infinite” and “loop, infinite See infinite loop”.

Google as a more direct approach: https://www.google.com/search?q=recursion

jeroen

Posted in Algorithms, Apple, Borland Pascal, Design Patterns, Development, Google, Pascal, Power User, Software Development, Turbo Pascal | Leave a Comment »

Wish more people named Peter Sollich for what he did in the Pascal world…

Posted by jpluimers on 2015/12/02

A small video reference to the work that Peter Sollich did for the Pascal world is at around 38:20 in this video: https://www.youtube.com/watch?v=btGj-PocjeU#t=2298

It is where Allen Bauer talks about his early years at Borland. He talks about a German guy there without naming him. It is Peter Sollich (he names them a few time in the newsgroups though).

Peter Sollich came from Germany where he had written a Turbo Pascal compatible compiler for the Atari ST (it used a m68k Motorola 68000 CPU which is a 32-bit processor on the internal side with a 16-bit wide data bus (transporting 16-bit words) on the outside using a 24-bit address (so it can address 16 mebibytes of memory) – hence ST for Sixteen/Thirtytwo).

Borland bought the source code which formed the base for the current 32-bit x86 compiler implementations of both Delphi and C++ Builder (they hired him as a contractor to do the port).

Rumour goes that Peter wrote many parts of the x86 code emitter on the flight from Europe to the USA.

Before the ST era there was already a CP/M Modula-2 compiler written by Peter Sollich and Martin Odersky which Borland bought even earlier and was turned into Turbo Modula-2.

For people interested, here are some links with ore details – where possible I saved them in the WayBack machine as sites tend to Ditch historically important information:

–jeroen

Posted in .NET, Borland Pascal, Delphi, Development, Pascal, Software Development, Turbo Pascal | 4 Comments »

Blast from the Past: `TThread` got introduced in Delphi 2

Posted by jpluimers on 2015/01/03

Thanks Nick Hodges for asking, and Uwe Raabe for answering:

Yep! Delphi 2 had TThread while Delphi 1 did not.

It resulted in an interesting thread including topics like cooperative multi-tasking and named pipes under DOS by using Turbo Pascal.

Boy, I remember the \pipe\ days and releasing a time slice by calling INT $28, $15 and $2F combinations like this:


asm
int $28
mov ax, $1000
int $15 { DESQview/TopView give up time slice }
mov ax, $1680
int $2F
end;

Note: you can even use INT $2F with AX=$1680 to check if you are running in a DOS x86 VM and other OS checks.

–jeroen

via: Anyone remember which version of Delphi introduced TThread?.

Posted in Borland Pascal, Delphi, Delphi 1, Delphi 2, Development, Pascal, Software Development, Turbo Pascal | 4 Comments »

 
%d bloggers like this: