Search Results

Showing results 1 to 40 of 96
Search took 0.02 seconds.
Search: Posts Made By: Duoas ; Forum: Pascal and Delphi and child forums
Forum: Pascal and Delphi Aug 4th, 2009
Replies: 12
Views: 948
Posted By Duoas
johnyjj2 if you really want help, please post your code.

What you've listed so far is nonsense.
Forum: Pascal and Delphi Aug 3rd, 2009
Replies: 12
Views: 948
Posted By Duoas
Whitespace between the keyword end and the period is not significant.

Perhaps you should post more code? It is hard to diagnose what is wrong.

With FPC, you must be sure to have the {$goto on}...
Forum: Pascal and Delphi Apr 3rd, 2009
Replies: 2
Views: 677
Posted By Duoas
In Pascal, a semicolon separates statements (and terminates directives).

So the following is correct:

program Hello; { Semicolon terminates directive }
begin
writeln( 'Hello world!' ) {...
Forum: Pascal and Delphi Nov 16th, 2008
Replies: 9
Views: 1,204
Posted By Duoas
It isn't a bug. Free Pascal is a little more strict about certain things than TP.
Your program should read:

program fred;

type funcparam=function(x:real):real;

function jim(x:real):real;
...
Forum: Pascal and Delphi Sep 6th, 2008
Replies: 6
Views: 1,413
Posted By Duoas
What version of TP are you using? My TP4 wouldn't get past the 8+ letter filename.

First, you are forbidden to use reserved words as identifiers. That means unit and in are off-limits.

You must...
Forum: Pascal and Delphi Sep 1st, 2008
Replies: 3
Views: 1,241
Posted By Duoas
Argh, I couldn't find a simple example on the web. So, without further ado:

hello.dpr

program hello;
{$apptype console}
uses greet;

var
index: cardinal;
Forum: Pascal and Delphi Aug 29th, 2008
Replies: 2
Views: 769
Posted By Duoas
Its full path is given as the first command-line argument. So you will want to add code to check to see if an mp3 file was supplied and autoplay it. How exactly you do it is up to you, but I...
Forum: Pascal and Delphi Aug 28th, 2008
Replies: 8
Views: 2,130
Posted By Duoas
> Maybe even scan the image and set the region pixel by pixel, so we will have a long list of vectorial "lines".
That is actually non-trivial to implement. But there do exist algorithms to do it. I...
Forum: Pascal and Delphi Aug 27th, 2008
Replies: 8
Views: 2,130
Posted By Duoas
I think I understand. You want the actual button itself to have the same shape as the polygon?

You'll have to create a region and assign it to your button.
See the MS Regions documentation...
Forum: Pascal and Delphi Aug 26th, 2008
Replies: 8
Views: 2,130
Posted By Duoas
Take a look in the documentation for the TCanvas.Pixels property. (Your button has a canvas). Also look at the OnMouseDown event.
Forum: Pascal and Delphi Aug 21st, 2008
Replies: 8
Views: 2,130
Posted By Duoas
If you are going to be using buttons with pixel images (like a GIF) you will need to do pixel-hit testing yourself.

Use the OnMouseDown event's X and Y values (which are relative to the button) to...
Forum: Pascal and Delphi Aug 3rd, 2008
Replies: 2
Views: 2,691
Posted By Duoas
I don't use Word, so I can't help... but what you are doing is unlikely to work well anyway because the window class names can change between versions of Word... But I think you should be looking for...
Forum: Pascal and Delphi Jun 7th, 2008
Replies: 6
Views: 1,544
Posted By Duoas
I know next to nothing about databases (because I really don't like messing with them).

But I wonder, being separate forms, are you using a separate connection to the database in each form?

It...
Forum: Pascal and Delphi Jun 1st, 2008
Replies: 6
Views: 2,081
Posted By Duoas
> hen i remove the line 22 then i get the answer 1 when input 90

That's because on line 21 you assign the answer to x instead of ans. I'd get rid of x too...
Forum: Pascal and Delphi Jun 1st, 2008
Replies: 6
Views: 2,081
Posted By Duoas
That's because on line 22 you abnormally terminate the program. Don't do that.
Forum: Pascal and Delphi May 29th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
Good job!

BTW, what compiler are you using? I had to pull out my old TP4 to compile it...
Forum: Pascal and Delphi May 29th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
I'm sorry, but I've already given you the answer without actually writing code. You'll have to think about it yourself now...

Good luck.
Forum: Pascal and Delphi May 28th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
Forget the 4 digits thing. You are trying to skip a step. (Though you may not realize it...)

Just take a single digit at a time. For binary, it should be a zero or a one.


i, n, foo: integer;...
Forum: Pascal and Delphi May 28th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
You've already got code that converts octal to a number (which you call OctToDec).

Remember, "octal", "decimal", etc. --these are not numbers. They are strings. Only people read and write strings....
Forum: Pascal and Delphi May 28th, 2008
Replies: 10
Views: 7,415
Posted By Duoas
Heh heh heh... Glad you got it working.


That, my friend, is a whole new can of beans. A really big, really deep one. Essentially you have to write your own cell editor. It isn't particularly...
Forum: Pascal and Delphi May 27th, 2008
Replies: 10
Views: 7,415
Posted By Duoas
Argh. You made me go and do this myself. I forgot how primitive a TStringGrid is... It derives from TCustomGrid but hides its DrawCell method...

Alas. I also forgot to wrap the method body in an...
Forum: Pascal and Delphi May 27th, 2008
Replies: 10
Views: 7,415
Posted By Duoas
1. Yep. Exactly. Sender should be sGrid.

2. Oops! It should be sGrid.DrawCell( ACol, ARow, Rect, State );
I just typed this stuff in off the top of my head...

You can resolve things like this...
Forum: Pascal and Delphi May 26th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
No, I mean convert bin (a string) to integer. Then convert the integer to hex (another string).

I hope that makes more sense.
Forum: Pascal and Delphi May 26th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
10110011101 is binary. You don't have to break it into anything. Just convert it to a number.

Once you get your number from the first step, convert it into hexadecimal: 59D.

Remember, the...
Forum: Pascal and Delphi May 26th, 2008
Replies: 10
Views: 7,415
Posted By Duoas
In your OnDrawCell event you need to choose your color based on whatever criteria you are interested in. The criteria may apply to more than one cell, even.


procedure TForm1.sGridDrawCell(
...
Forum: Pascal and Delphi May 26th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
Forum: Pascal and Delphi May 25th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
You'll have to write that function yourself.

For hexadecimal, remember that the values of the digits are:
digits: values
0..9: 0..9
A..F: 10..15

So the DigitToInt( 'C' ) should return the...
Forum: Pascal and Delphi May 25th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
Remember, a char is a different type than an integer. You cannot add or multiply characters.

Also remember, the point is that the digits 0, 1, 2, 3, ... are representations of numbers, not numbers...
Forum: Pascal and Delphi May 22nd, 2008
Replies: 10
Views: 7,415
Posted By Duoas
Hmm, sorry. I thought I responded to this already.

You'll have to set the DefaultDrawing property to false, and provide a method for the OnDrawCell event.

Here's an example I googled....
Forum: Pascal and Delphi May 22nd, 2008
Replies: 25
Views: 3,547
Posted By Duoas
I've already given you all the help I can without giving you the answer. You have to use your brain now.

Think about what you know about converting binary to decimal, and apply the same logic to...
Forum: Pascal and Delphi May 21st, 2008
Replies: 25
Views: 3,547
Posted By Duoas
You are very close.

You need to move line 22 up before line 19.
On line 19 you accidentally used the wrong variable. (Also, is the same as strDigit := strBin[intLoop].)

The difference between...
Forum: Pascal and Delphi May 20th, 2008
Replies: 25
Views: 3,547
Posted By Duoas
We won't do your homework or reply offline.

However, I can help you think through your problem.

A number is a number is a number is a number, no matter how it is represented for us humans. 10...
Forum: Pascal and Delphi May 16th, 2008
Replies: 2
Views: 2,348
Posted By Duoas
That C code is a mess. And it is dangerous because it uses bitfields (which C++ does not guarantee to be packed in any specific order -- so results vary by compiler!).

Alas, why don't programmers...
Forum: Pascal and Delphi Mar 4th, 2008
Replies: 6
Views: 2,873
Posted By Duoas
It comes with time.

Sorry, for the error. I accidentally mixed C and Pascal. The line should read
Timer1.Tag := n div 10;

The "extended" is the IEEE 80-bit Extended Precision floating point...
Forum: Pascal and Delphi Mar 1st, 2008
Replies: 6
Views: 2,873
Posted By Duoas
Make sure your form class looks something like this:

type
TForm1 = class(TForm)
...
public:
{ Public declarations }
procedure sendNsecondsWorthOfBtoNotepad( n: integer );
...
Forum: Pascal and Delphi Feb 29th, 2008
Replies: 6
Views: 2,873
Posted By Duoas
That timer event will not work like you expect. The Int10 is not guaranteed to have any specific value. While it may appear to work sometimes (just as a fluke of how the stack works), it will...
Forum: Pascal and Delphi Feb 29th, 2008
Replies: 5
Views: 5,092
Posted By Duoas
Hmm, that's right. (Stupid grid controls are poorly designed... they give everyone and everything grief...)

You'll have to help it along. This is what I did. (I used a tStringGrid to test.)

Set...
Forum: Pascal and Delphi Feb 29th, 2008
Replies: 5
Views: 5,092
Posted By Duoas
Ah, ye olde rodent...

Remember, a (basic) mouse only does two things: move and click (single click, that is).

So, Windows and Delphi and whatever else have to make some basic assumptions about...
Forum: Pascal and Delphi Feb 26th, 2008
Replies: 5
Views: 1,963
Posted By Duoas
You need a loop. Like repeat..until or while..do.

You can also check your answers using a case statement.
Forum: Pascal and Delphi Feb 4th, 2008
Replies: 8
Views: 4,927
Posted By Duoas
> sorry, i didnt read it properley

I do that all the time... :$
Showing results 1 to 40 of 96

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC