[fpc-pascal]FPC Error! :(
James Mills
prologic at prologitech.com
Fri Feb 14 10:36:50 CET 2003
On Thu, Feb 13, 2003 at 06:04:07PM -0000, Lee, John wrote:
> This isn't enought info! A bit more info needed eg what version/flavour of
> fpc, date, what source are you compiling...Regards John
Better yet, I've found out what the problem is...
unit dataChannels;
interface
uses
sysUtils, Functions, tokenizerClass, channelClass;
var
channels: PChannel;
nChannels: Integer;
Portion of dataChannels.pas
unit channelClass;
interface
uses
sysUtils, Functions, tokenizerClass;
type
TNicks = class(TObject)
constructor init(tmpNick: String);
destructor done;
private
nick: String;
modes: String;
lastMsg: longInt;
public
procedure setNick(tmpNick: String);
procedure addMode(tmpModes: String);
procedure delMode(tmpModes: String);
procedure update(cTime: longInt);
function getNick: String;
function getModes: String;
function getLastMsg: longInt;
end;
PNicks = ^TNicks;
type
TChannel = class(TObject)
constructor init(channel: String);
destructor done;
private
name: String;
topic: String;
nServices: Integer;
services: PNicks;
nNicks: Integer;
nicks: PNicks;
modes: String;
public
function getName: String;
procedure setTopic(s: String);
procedure addMode(tmpModes: String);
procedure delMode(tmpModes: String);
function getModes: String;
function getTopic: String;
procedure addService(nick: String);
procedure delService(nick: String);
function getService(index: Integer): TNicks;
function numServices: Integer;
procedure addNick(nick: String);
procedure delNick(nick: String);
function getNick(index: Integer): TNicks;
function numNicks: Integer;
end;
PChannel = ^TChannel;
implementation
Portion of channelclass.pas
unit sChanServ;
interface
uses
Services, ircCommands, Data, Functions, sysUtils, tokenizerClass,
Modules, Time, dbNicks, dataNicks, dbChannels, stringsClass, nickClass,
Config, dataChannels, channelClass;
.
.
.
procedure TChanServ.doLIST(source: String; data: String);
var
tokens: TTokenizer;
channel: String;
what: String;
index: Integer;
I: Integer;
begin
tokens := TTokenizer.init(data);
channel := tokens.nextToken;
what := tokens.nextToken;
tokens.done;
index := getChannel(channel);
if upperCase(what) = 'NICKS' then
begin
tellUser(self, source, #2 + '***' + #2 + ' List of nicks on ' +
channel + #32 + #2 + '***' + #2);
for I := 0 to (channels[index].numNicks - 1) do
begin
tellUser(self, source, intToStr((I + 1)) + ' :' +
channels[index].getNick(I).getNick);
end;
tellUser(self, source, #2 + '***' + #2 + ' End of List ' + #2 +
'***' + #2);
end
else
begin
tellUser(self, source, 'Invalid listing type.');
end;
end;
Portion of sChanServ.pas
tellUser(self, source, intToStr((I + 1)) + ' :' + channels[index].getNick(I).getNick);
This line of code access the dataChannels module, of the variable,
channels of type PChannels (declared in channelclass.pas). Yet it is
also accessing a class inside channelclass.pas,
uses
Services, ircCommands, Data, Functions, sysUtils, tokenizerClass,
Modules, Time, dbNicks, dataNicks, dbChannels, stringsClass, nickClass,
Config, dataChannels, channelClass;
What causes the internal problem is when the compiler cannot find the
procedure/function of the inner class, if channelClass is left out of
the uses delcaration, that internal error will come up. Which is
undocumented.
channelClass is only needed so that the compiler knows what .getNick is
after channels[index].getNick(I)
The compiler should probably say, '<sourceFile>(x,x) Error: Identifier not found <symbol>
??
hope this helps.
cheers
James
>
> -----Original Message-----
> From: James Mills [mailto:prologic at prologitech.com]
> Sent: Thursday, February 13, 2003 17:21
> To: fpc-pascal at lists.freepascal.org
> Subject: [fpc-pascal]FPC Error! :(
>
>
> Hi,
>
> What on earth does: schanserv.pas(715) Fatal: Internal error 55665566
> mean ?
>
> cheers
> James
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
> This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list