loop lopy wrote:
I omitted the additional type and the first compilation error has been removed. Now I have two additional compilation errors. My code is:
program Ex1 (input, output);
type NumNode = record Value: integer; pNext: ^ NumNode; end;
nNumber = record DigitsAmount: integer; DigitValue:^ NumNode; MSD: integer; DigitBase: integer; end;
function nNumberIsEmpty (Num: nNumber): boolean; begin nNumberIsEmpty := (Num.DigitValue=0); end;
Num.DigitValue is of type ^NumNode. You are comparing it with an integer. And so forth. Just fix the errors. You would be well advised to define a separate pointer type for this, as in:
TYPE (* The one case where things don't have to be predeclared *) NumNodeptr = ^NumNode;
NumNode = record Value : integer; pNext : NumNodeptr; end;
nNumber = record DigitsAmount : integer; DigitValue : NumNodeptr; MSD : integer; DigitBase : integer; end;
The indentations show that the type definitions are subservient to the TYPE section, and what identifiers are subservient to what record types. It helps to be able to see clearly what you have defined.
Please don't fire off frantic disconnected messages with different subjects every two minutes. Take your time and think about things, then compose something clear, and review it before you send it.