pascal

Are there any useful tools to anaylse an existing Borland Pascal 7.0 App

We have a body of legacy Apps written in Borland Pascal 7.0 of 16bit, real mode Fame. Do you know any good tools useful for analyzing such software, such as call graphs, cross-references, IDEs? ...

How to implement Matrix operations in Pascal?

I need to implement operations with matrices and size of matrix has to be variable. The only solution I came up with is to use linked list: [pointer to this row, pointer to another row] -> [element 1,1; link to another element] -> [element 1,2, link to another element] -> .... -> [nil] | v [pointer to this row, pointer to ano...

What is it about the Think Pascal debugger that makes it so legendary ?

I have been sharpening the coding knives and getting back into dev. A few years ago, many people mentioned that the Symantec Think Pascal debugger that came on the (classic) Mac was the absolute bee's knees, and that nothing else was like it anywhere. I found that statement odd, considering that no one has tried to clone said debugger......

How do I get a registry value in Inno Setup when the value only uses the default name?

I'm trying to get the install directory of an application from the Windows Registry (Google Sketchup in this case) with Inno Setup's Pascal scripting so I can install a plugin there. The registry key doesn't have a name, it just has "(Default)" in Regedit. I tried this: RegQueryStringValue( HKLM, 'SOFTWARE\Google\Google Sketchup 6', ...

What causes problems with this piece of code ?

Hi! I was just wondering why this certain problem happens to me. If you can help me, I will appreciate it. Program factorial; uses crt; var f, i: Integer; begin f:=1; for i:=1 to 5 do f:= f * i; write(f); readkey; end. Okay, That works fine and the result is 120. And it's true. Now, here's the problem. If I asked the u...

Easy Questions for Teaching Pascal to a kid

I've been asked to tutor Pascal to a kid. Despite never seen Pascal before I did manage to get a tutorial and I now know enough to teach him. I am writing you guys to see if anyone can point me out some basic exercises that involve simple algorithms, Something like: Sort this array, find the average, etc... It can be in any language, I...

Pascal and its current applications

I studied Turbo Pascal in 1997 and I liked it very much as a language. Everything was very structured and the compiler made sure you did things the right way. I later tried Delphi but never got very interested in it. Since then I've used a lot of different programming and scripting languages (C, C++, PHP, Python, Perl, TCL) and recently...

Problems with pointers when building a Pascal compiler in C

Hello guys I'm facing some problems on the lexical analysis of my compiler I had declared the following pointer char *words[29]={ "program", "label", "integer", "word", "char", "byte", "shortint", "logint", "real", "single", "double", "string", "boolean", "var", ...

How to convert a string version value to a numerical value in Inno Setup Scripts?

I want to develop a setup package for conditionally upgrading an existing package. I want to check the existing software version against to-be-installed version. In order to do that, I have to compare the version strings. How can I convert the string value to a numerical value in a Inno setup script? RegQueryStringValue(HKEY_LOCAL_MACH...

Is the dif or patch adder for Delphi IDE, ie if someone makes patch and I want to add it to my project automatically?

Is there DIFF plugin availaple for Delphi? I need simple add diff or patch file to my project, replaceing the porject code, that was changed in the patch, but keeping also the old one incase of falling back to old file without the patch. ...

Delphi = Pascal? Resources for Learning?

Well, I am new to Delphi and really offline programming in general (other than the standard C++) and recently acquired a copy of Delphi and was kind of interested in starting with it. I read somewhere that it uses Pascal but I was confused on if it used Pascal, as in it was programmed with it, or if it used Pascal as in the language you ...

Repeated setters logic in Delphi

For each setter of a class I have to implement some event logic (OnChanging, OnChanged): procedure TBlock.SetWeightIn(const Value: Double); var OldValue: Double; begin OldValue := FWeightIn; DoOnChanging(OldValue, Value); FWeightIn := Value; DoOnChanged(OldValue, Value); end; procedure TBlock.SetWeightOut(const Value: Double); ...

DELPHI: how to use "break" outside of loop or case?

consider the following delphi pascal code: var tc: TComponent begin { do something to get tc } repeat if(tc is TDBEdit)then begin if(check_something_about_edit(tc))then break; do_something_else_edit(tc); break; end else if(tc is TBMemo) then begin if(check_something_about_memo(tc))then break; do_something_else_...

Pascal cheat sheet.

Hi guys. I'm looking for a simple Pascal cheat sheet, where briefs the basics (loop statements, program structure, data types, etc.) I can't find one, not even in Cheatsheets.com!!! Thanks! ...

Case statement with logic operators (< > =, etc) in Pascal.

Hello there! I'm having trouble making this work. Apparently, i can't use > or < in the case sentence, is there a workaround for this? Thanks! case num of 0: begin cont_0 := cont_0 + 1; end; > 0: begin cont_pos := cont_pos + 1; sum_pos := sum_pos + num; end; ...

What is the fastest possible way to sort an array of 7 integers?

This is a part of a program that analyzes the odds of poker, specifically Texas Hold'em. I have a program I'm happy with, but it needs some small optimizations to be perfect. I use this type (among others, of course): type T7Cards = array[0..6] of integer; There are two things about this array that may be important when decidin...

What is the compiler directive to generate a detailed map file.

I wish to know is there a compiler directive which I can use in my code (not from the UI) to set that the compiler/linker should generate a detailed map file. Is there something like: {$MAPFILE DETAILED}? I am using Delphi 2009. ...

Does any dialect of Pascal allow a variable number of arguments?

This is a question for the older programmers. Years ago, I encountered a dialect of Pascal which allowed a variable number of arguments, through some kind of extension. Does anyone know of a current dialect of Pascal which allows a variable number of arguments? Given that Pascal is not as popular as it used to be, I wouldn't be surpr...

Hanging else problem?

What is the "hanging else" problem? (Is that the right name?) Following a C++ coding standard (forgot which one) I always use brackets (block) with control structures. So I don't normally have this problem (to which "if" does the last(?) else belong), but for understanding possible problems in foreign code it would be nice with a firm u...

How to recreate a function retrieving the highest element of an object?

My plan is to make a function that retrieves the highest element of an object, so to speak, the upper range of an array.In other words,I'm trying to get the the code of the function High(). What I have tried so far: function High2(var X):integer; begin Result:=Pbyte(Cardinal(@X)-1)^-1; end; The function above should read the va...