Subj : Re: Silly question
To : Bj�rn Felten
From : Sean Dennis
Date : Sun May 01 2005 10:23 pm
*** Quoting Bj�rn Felten from a message to Sean Dennis ***
BF> Rather about ordinal expressions. A string can never be an OE. Try
BF> Char, Byte or something more ordinal.
Embarrasingly enough, I discovered that out after I wrote the message by
looking it up online. ;) Turns out that Case..Of can only use ordinal
expressions. A little code wrangling and all works out. However, now I'm
having another problem.
I'm writing a little BBS list door for my system. Nothing too hard. But I'm
getting a type mismatch error. Let me explain a little more:
Here's the type and how I declare it:
Type
BBS = Record
BoardName : String[70];
SysopName : String[40];
Software : String[30];
Phone : String[20];
Telnet : String[30];
Hours : String[15];
URL : String[68];
Networks : String[68];
Comments : String[68];
End;
Var
BBSFile : File of BBS;
BBSR : BBS;
(BBSR is short for BBSRecord)
Now, when I first tried to use this:
Inpt(Temp, 40, 14, 9);
BBSR.SysopName := Temp;
(Inpt is a special routine for input in the doorkit I'm using. The Temp
variable is a string.)
When I did:
Inpt(BBSR.SysopName, 40, 14, 9);
I got "Type mismatch" errors. Okay, so I worked around it using the above
routine.
When I tried:
Write(BBSFile, BBSR.BoardName);
I got the error again.
Forgive my silly questions as I haven't touched the compiler in about a year
really on a new project, but why am I getting those errors when that particular
variable is declared as a string, yet I can't write it to a file of the same
type?
I have problems grasping simple solutions now due to a variety of causes, but
I'm just not understanding why it's not working. I'm sure it's something
stupid that I'm not seeing.
Any help is appreciated.
Thanks,
Sean
//
[email protected] |
http://outpostbbs.net | ICQ: 19965647
--- Telegard/2 v3.09.g2-sp4/mL
* Origin: Outpost BBS - Kennesaw, GA - outpostbbs.net (1:18/200)