[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Shade

3/7/2005 10:22:00 PM

ìÀÄÉ, ÞÅÇÏ ÏÎÏ ÏÔ ÍÅÎÑ ÈÏÞÅÔ?
....
type
filetype = array [1..9,0..9] of array [1..9,0..9] of string;
var
dll : file of filetype;
....
-------------------------------------------------------
[Error] : Unsupported Language feature: 'typed or untyped file'

5 Answers

Roman Scherbina

3/7/2005 10:58:00 PM

0

S> ìÀÄÉ, ÞÅÇÏ ÏÎÏ ÏÔ ÍÅÎÑ ÈÏÞÅÔ?
S> ...
S> type
S> filetype = array [1..9,0..9] of array [1..9,0..9] of string;
S> var
S> dll : file of filetype;
S> ...
S> -------------------------------------------------------
S> [Error] : Unsupported Language feature: ''typed or untyped file''

Á ËÁËÁÑ ÄÅÌØÆÑ? 7-ÁÑ ÓÒÕÇÁÌÁÓØ ÎÅÍÎÏÇÏ ÐÏÄÒÕÇÏÍÕ:

[Error] : Type ''filetype'' needs finalization - not allowed in file
type

×ÏÔ ÏÐÉÓÁÎÉÅ ÏÛÉÂËÉ ÉÚ ÈÅÌÐÁ, ÍÏÖÅÔ ÐÏÍÏÖÅÔ ?

Certain types are treated specially by the compiler on an internal
basis
in that they must be correctly finalized to release any resources that
they might currently own. Because the compiler cannot determine
what type is actually stored in a record''s variant section at runtime,
it is not possible to guarantee that these special data types are
correctly finalized.

program Produce;
type
Data = record
name : string;
end;
var
inFile : file of Data;
begin
end.

String is one of those data types which need finalization, and as such
they cannot be stored in a File type.

program Solve;
type
Data = record
name : array [1..25] of Char;
end;
var
inFile : file of Data;
begin
end.

One simple solution, for the case of String, is to redeclare the type
as
an array of characters. For other cases which require finalization,
it becomes increasingly difficult to maintain a binary file structure
with standard Pascal features, such as ''file of''. In these situations,
it is probably easier to write specialized file I/O routines.

--
ÒÏÍÁÎ

Shade

3/8/2005 10:25:00 AM

0

> Á ËÁËÁÑ ÄÅÌØÆÑ? 7-ÁÑ ÓÒÕÇÁÌÁÓØ ÎÅÍÎÏÇÏ ÐÏÄÒÕÇÏÍÕ:
×ÏÓØÍÁÑ, ÍÁÔØ Å£
ÏÎÁ ÎÁ ×ÓÅ ÆÁÊÌÙ ÔÁË ÒÅÁÇÉÒÕÅÔ
ÅÓÔØ ÇÄÅ-ÔÏ ÏÐÉÓÁÎÉÅ ËÁË Ó ÆÁÊÌÁÍÉ ÒÁÂÏÔÁÔØ, Ó ÎÕÌÑ ÖÅÌÁÔÅÌØÎÏ?

Chapaev

3/9/2005 6:43:00 AM

0

> filetype = array [1..9,0..9] of array [1..9,0..9] of string;
> var
> dll : file of filetype;
îÅ ÚÎÁÀ, ÞÔÏ ËÏÎËÒÅÔÎÏ ÈÏÞÅÔ ÏÔ ÔÅÂÑ äÅÌÆÉ, ÎÏ ÔÁËÁÑ ËÏÎÓÔÒÕËÃÉÑ ÒÁÂÏÔÁÔØ ÎÅ
ÂÕÄÅÔ, 100%. åÓÌÉ ÕÖ ÎÁÄÏ ÓÔÒÏËÉ × ÆÁÊÌ ÐÉÓÁÔØ, ÒÁÂÏÔÁÊ Ó ShortString.

á ×ÏÏÂÝÅ ÉÍÈÏ ä8 -- ÄÏÈÌÙÊ ÂÏÂÉË... ìÕÞÛÅ ÕÖ ÓÒÁÚÕ ÎÁ ä2005 ÐÅÒÅÈÏÄÉÔØ, ÉÂÏ
ÏÎ -- ÒÕÌÅÚ (ÏÐÑÔØ ÖÅ ÉÍÈÏ).

s&r

3/11/2005 11:47:00 AM

0

ëÓÔÁÔÉ Á ÕÄÅ ÍÏÄÎÏ ÎÁÊÔÉ Delphi 2005 × ÓÅÔËÅ???

ñ ÎÁÛÅÌ ÁÒÈÉ×Ù, ÎÏ ËÏÇÄÁ ÓÔÁ×ÌÀ - ÐÉÛÅÔ ÞÔÏ ÎÁÄÏ MS .NET Framework ËÏÔÏÒÙÊ
×ÒÏÄÅ ÓÔÏÉÔ ÕÖÅ....

óÅÎËÓ

Chapaev

3/14/2005 8:49:00 AM

0

> ëÓÔÁÔÉ Á ÕÄÅ ÍÏÄÎÏ ÎÁÊÔÉ Delphi 2005 × ÓÅÔËÅ???
åÓÔØ ÄÉÓË (ÂÅÚ ÈÅÌÐÁ :-(((((((((( ), ÍÏÇÕ ÏÄÏÌÖÉÔØ ÄÌÑ ×ÙËÌÁÄÙ×ÁÎÉÑ × ÓÅÔØ.