Am 03.01.2014 08:36 schrieb "Mark Morgan Lloyd" <
markmll.fpc-pas...@telemetry.co.uk>:
>
> Sven Barth wrote:
>>
>> On 02.01.2014 22:27, Mark Morgan Lloyd wrote:
>>>
>>> Sven Barth wrote:
>>>>
>>>> === code begin ===
>>>>
>>>> var
>>>>   dirinfo: SearchRec;
>>>> begin
>>>>   dirinfo := Default(SearchRec);
>>>
>>>
>>> Out of curiosity, does this work:
>>>
>>> var
>>>     dirinfo: SearchRec= Default(SearchRec);
>>>
>>
>> Not yet. It's on my ToDo list however since I implemented Default().
>
>
> That would be useful. I'm currently trying to do a line-by-line
transcription of a CPU emulator that somebody's been misguided enough to
write in JavaScript. Being able to deal concisely with things like
>
>     this.memMod = [ // Array of memory module words as Float64s (8 x 4KW
each)
>         null, null, null, null, null, null, null, null];
>
> would be a decided advantage.

In case of arrays you can already do the following:

=== code begin ===

const
  NullMemMod: array[0..7] of Pointer(* or whatever *) = (Nil, Nil, Nil,
Nil, Nil, Nil, Nil, Nil);

// somewhere else:
Self.MemMod := NullMemMod;

=== code end ===

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to