*/
Know a good article or link that we're missing? Submit it!
*/

View \TUTOR02.PAS

Halcyon version 3.0

Submitted By: Unknown
Rating: (Not rated) (Rate It)


program TUTOR02;
{$N+,E+}          {Required for floating point number handling}
uses
   CRT,
   GSOB_DBF,
   GSOB_VAR;
var
   MyFile  : GSO_dBaseFld;
   i       : integer;
   s1,
   s2      : string[30];

procedure WorkTheFile;            {reads the file, reverses LASTNAME, }
                                  {displays fields, and writes the record}
begin
   MyFile.GetRec(Top_Record);     {Get the first record in the file}
   while not MyFile.File_EOF do   {Repeat until end-of-file}
   begin
      s1 := MyFile.StringGet('LASTNAME');
      s2 := '';
      for i := 1 to length(s1) do s2 := s1[i] + s2;
      Myfile.StringPut('LASTNAME',s2);
      writeln(s2,', ',
              MyFile.StringGet('FIRSTNAME'));
      MyFile.PutRec(MyFile.RecNumber);
      MyFile.GetRec(Next_Record); {Get the next sequential record}
   end;
end;

{------ Main Routine ------}

begin
   ClrScr;
   MyFile.Init('TUTOR1');
   MyFile.Open;
   WorkTheFile;
   MyFile.Close;
end.

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.