Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Delphi 7 Question

Status
Not open for further replies.

adore

Programmer
Apr 10, 2011
1
US
I'm new to Delphi. I used to, many years ago, write Winsock stuff in Visual Basic, but its been a long time since I've done any programming. I'm trying to install some MIDI components, and I get an error, which any one of you could probably solve quite easily.. anyway heres the 3 lines from the debugger...


If anyone could help me I'd really appreciate it. I know its probably a really simple question but I'm quite new to this, an explanation would be nice. Thanks!
 
The first error is just saying that the control variable that you use for a for loop must be local to the for loop and not a global variable.

Instead of this:
Code:
program test1;
var
  i: integer;

procedure mytest;
  begin
    for i := 1 to 10 do
    ...
  end;

Do this:
Code:
program test2;

procedure mytest;
  var
   i: integer;
  begin
    for i := 1 to 10 do
    ...
  end;

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top