Forum: Pascal and Delphi Mar 30th, 2009 |
| Replies: 2 Views: 430 The comma separates the arguments you provide to a function. Seems to me you have too many commas here. You have two arguments a string and an integer, separate them with one comma.
B.t.w. your... |
Forum: Pascal and Delphi Mar 22nd, 2009 |
| Replies: 5 Views: 529 Seems ok. What does not work? |
Forum: Pascal and Delphi Mar 8th, 2009 |
| Replies: 2 Views: 958 Here,there and everywhere...all over the place, start a course on cooking spagetti. Stop programming if you want to continue on this way, else try to use a while loop. |
Forum: Pascal and Delphi Jan 31st, 2009 |
| Replies: 10 Views: 1,023 Check your if statements once again. 0 is a perfectly legal value to calculate here, it will give you two equal roots which have the value -b/2a.
Glad to be of help, mark this as solved. |
Forum: Pascal and Delphi Jan 31st, 2009 |
| Replies: 10 Views: 1,023 The if statement was invented for that.
if InsideRoot < 0 then -->negative, give a message about complex roots and stop(for the moment)
else -->continue the calculation
I don't know what exitcode... |
Forum: Pascal and Delphi Jan 31st, 2009 |
| Replies: 10 Views: 1,023 On which line do you get the error?
You also must test if InsideRoot is negative or not.
Ever took the square root of a negative number? That's where complex numbers creep in... |
Forum: Pascal and Delphi Jan 31st, 2009 |
| Replies: 10 Views: 1,023 If I where you I would not make the calculation with integers.
This is typically something where real numbers (and even complex numbers!) are involved. So get rid of the DIV, make A,B,C etc. real... |
Forum: Pascal and Delphi Jan 31st, 2009 |
| Replies: 10 Views: 1,023 The sqrt function returns a value of type Extended. ( number with a decimal point in it.) Internally these numbers are stored differently then Integer or LongInt.
That's why they are called... |
Forum: Pascal and Delphi Jan 4th, 2009 |
| Replies: 11 Views: 1,007 Correct but weird :
procedure display_monies0 (counter: integer);
begin
if counter = 0 then
writeln(' /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\');
if counter = 0 then
writeln(' / \');... |