new to lazarus :) making a csv address book? lazarus / 10-Designer ---------------------------------------------------------------------- cazzajay · 2009-06-30 16:38 hello all, i used to use delphi back when i was a teenager (im 24 now) and have downloaded this to take it up as a hobby (relaxation in a weird way) again.  my first project to remind me of how to use it is an address book using CSV files (for eg. 1st row "Name, address, tel" 2nd row "bill gates, 100 millionnaire row, 123456789" etc...) Can anyone give me some guidance (treat me as a complete novice!!!) on how i would use this to run a basic query style search by name, and how i would populate the CSV with a new line i.e. new record?  I might not be phrasing my request very clearly so if i don't make sense please let me know... thanks!!!  ...and nice work with Lazarus, the borland delphi version i used was given free with a magazine years ago and it has changed a lot since then (i think it was version 3 i had  ). ---------------------------------------------------------------------- Loesje · 2009-07-09 19:55 You can have a look here: http://wiki.lazarus.freepascal.org/Lazarus_Tdbf_Tutorial, it doesn't use .csv files but the idea is the same. In general, look at the database-tutorial: http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial ---------------------------------------------------------------------- rocotilos · 2009-09-05 18:35 Hi! I just join this forum... i also been a hardcore fan of Delphi 3 for > 10 yrs now... yeah, i agree it give some sort of relaxation to create apps with it. just now dl'ed the Lazarus.. and WOW!! i dont know why i didnt use it before. for the CSV method, u can use the following procedure. Actually it is one of my components source code. procedure TSplitString2.SetSourceString(const s: string); var   lenS,   FldLen,   i,x: Integer;   tmpS: String;   EOFChar: String[1]; begin   FSourceString := s;   FFieldList.Clear;   lenS := Length(s);   if lenS > 0 then   begin     i := 1;     while (i <= lenS) do     begin       if (Copy(s,i,1) = '''') then       begin         EOFChar := '''';         i := i + 1;       end else         EOFChar := FSepString;       tmpS := Copy(s,i,MaxInt);       FldLen := Length(tmpS);       for x := 1 to FldLen do  { Seek end of field }       begin         if (EOFChar='''') and ((Copy(tmpS,x,2)=''''+FSepString) or ((x=FldLen) and (Copy(tmpS,x,1)=''''))) then         begin           FldLen := x - 1;           break;         end;         if (EOFChar=FSepString) and (Copy(tmpS,x,1)=FSepString) then         begin           FldLen := x - 1;           break;         end;       end;       FFieldList.Add(Copy(s,i,FldLen));       { Set i to start position of next field (including it's delimiters)}       i := i + FldLen + 1;       if ((EOFChar = '''') and (Copy(s,i,1) = FSepString)) then         i := i + 1;     end;     FError := False;   end else     FError := True;    { Error because string length = 0 } end; u need to set FSepString to a comma, or if u want DSV, then u set it to a DOT.. or whatever symbol u want as long as it is a char. Then this procedure will input each of the items in FieldList. eg, if the s = 'lazarus,is,cool,program' then FieldList[0]=lazarus, FieldList[1]=is.. etc. Cheers ---------------------------------------------------------------------- chrnobel · 2009-09-06 21:59 If you are going to make an address book, where you can add records, search, etc., go for using a database instead as Loesje suggests. You can make quite comprehensive databases with dBase, and it is much easier to use than trying to make a CSV database - CSV is for importing/exporting data, not for use as a database. /Christian ---------------------------------------------------------------------- rocotilos · 2009-09-08 05:40 I dont know about u. But for me also, sometimes using CSV data and save in textfiles are enough. unless you are planning to have a bigger app, then i personally think csv/text file is sufficient. for eg, i have a software that i made only for saving some daily data of my work. i dont need it to be kept for long time, but just 1 day.. so the csv/text data is very easy to make and helpful for this scenario. ---------------------------------------------------------------------- davesimplewear · 2009-09-21 12:25 Look at the JCSV csv components, simple to use and has an integrated search on any field. The wiki page with an example program is here: http://wiki.lazarus.freepascal.org/JCSV_(Jans_CSV_Components)