Re: type conversion problem




"Martin S" <shieldfire@xxxxxxxxx> wrote in message
news:43ddb4f7$0$683$b9f67a60@xxxxxxxxxxxxxxxxxxxxx
>I get type mismatch errors (untyped - string) on the following

Tough to say what the problem is since you don't indicate the line(s) that
generate the error(s).

>
> If FileExists('fontman.rc') Then
> //Read config file
> begin
> AssignFile(ConfigFile,'fontman.rc');
> Reset(ConfigFile);
> While not EOF(ConfigFile) do
> begin
> Lookingfor:= ReadLn(ConfigFile, Configtext);

ReadLn is a procedure, not a function. It does not return a type.

> Lookingfor:= AnsiRightStr(Lookingfor, MyFonts=);

Second parameter is not valid Delphi syntax.

> Lookingfor := Trim(Lookingfor);
> // Do something with result e.g.
> ShowMessage(Lookingfor);
> end;
> end
> Else

Its tough based on your post to figure out exactly what you are trying to
do, but it looks like you are reading a configuration file looking for an
entry MyFonts. If the file is structured as a standard INI file, use
tIniFile - see the help for details. An alternative is J. French's
suggestion that you look at tStringList - look up Names & Values properties
in the help.


.