Crea un archivo de datos plano para el uso con testds.
{ $Id: createds.pp,v 1.3 2005/02/14 17:13:12 peter Exp $ This file is part of the Free Pascal run time library. Copyright (c) 1999-2000 by Michael Van Canneyt, member of the Free Pascal development team Creates a flat datafile for use with testds. See the file COPYING.FPC, included in this distribution, for details about the copyright. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **********************************************************************} program createds; {$mode delphi} uses ddg_rec,sysutils; Type IndexFile = File Of Longint; Var F : TDDGDataFile; I : Integer; S : String; L : IndexFile; TableName : String; IndexName : String; ARec : TDDGData; begin If ParamCount<>1 then begin Writeln('Usage: createds tablename'); Halt(1); end; TableName:=ChangeFileExt(paramstr(1),'.ddg'); IndexName:=ChangeFileExt(TableName,'.ddx'); Assign(F,TableName); Rewrite(F); For I:=1 to 100 do begin S:=Format('This is person %d.',[i]); With Arec Do begin Name:=S; height:=I*0.001; LongField:=i*4; ShoeSize:=I; WordField:=i*2; DateTimeField:=Now; TimeField:=Time; DateField:=Date; Even:=(I mod 2) = 0 end; Write(F,ARec); end; Close(F); Assign(L,IndexName); Rewrite(L); For I:=0 to 100-1 do Write(L,I); Close(L); end. { $Log: createds.pp,v $ Revision 1.3 2005/02/14 17:13:12 peter * truncate log }
Antes de comentar: Gran parte de los ejercicios propuestos no tienen librerías debido a que Wordpress las eliminó al verlas como etiquetas HTML. Si sabes/tienes/conoces las librerías que hacen falta, déjalo en los comentarios. Y lo mas importante: Todos los ejemplos fueron realizados por personas con únicamente conocimiento básico del lenguaje, no de programación.
Otro punto importante: Si vas a sugerir un segmento de código en algún lenguaje debes hacerlo así:
- Si es lenguaje C [c]Código en C[/c]
- Si es lenguaje Pascal [pascal]Aquí dentro el código de Pascal[/pascal].
De esta manera el código coloreas el código.
Otro punto importante para muchos que sienten que se les ignora: Todos los comentarios los reviso y en su debido momento los apruebo, pero ojo con el con lo siguiente:Me reservo el derecho de alterar, publicar o no los comentarios as´ como cambiar mis condiciones en el momento que así lo requiera.
¿estas de acuerdo? entonces adelante que ya te he quitado bastante tiempo leyendo esta basura de advertencias :)