FileManager lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Gilles · 2018-10-17 12:30 Hello Je n'y arrive pas. It is so difficult to learn a new langage (objective P) and new routines … I need a model. This is a simple program I use to read a string from a file, starting at L_beg and having x_cnt characters. It would be marvellous if somebody could translate it in a new form of langage. Just a model to understand how it works (just a procedure doing the same thing) : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function f_ReadStringFromACloseFile (xx_ref: FSRef;                                    L_beg: SInt64; x_cnt: SInt16; var S: string): OSErr;    var      xx_dfn: HFSUniStr255;        xx_fkp: FSForkIOParam;        xErr, yErr: OSErr;        x_rfn: FSIORefNum;begin    S := '';     xErr := FSGetDataForkName(xx_dfn);      if xErr = noErr then        xErr := FSOpenFork(xx_ref, xx_dfn.length, @xx_dfn.unicode, fsRdPerm, x_rfn);     if xErr = noErr then    begin        xx_fkp.forkRefNum := x_rfn;      xx_fkp.buffer := @S;        xx_fkp.requestCount := x_cnt + 1;      xx_fkp.positionMode := noCacheMask + fsFromStart;        xx_fkp.positionOffset := L_beg;         xErr := PBReadForkSync(xx_fkp);        yErr := FSCloseFork(x_rfn);         if xErr = noErr then            xErr := yErr    end;     f_ReadStringFromACloseFile := xErrend; ---------------------------------------------------------------------- BeanzMaster · 2018-10-17 14:12 Hi Gilles Bonjour Gilles, je te suggère de venir sur https://lazarus.developpez.com la communauté française pour Lazarus. Tu y trouvera de très bon tutoriel sur le langage pascal et sur l'utilisation de Lazarus. Et ce sera avec plaisir que nous t'aiderons. N'hésites donc pas à t'inscrire et poser toutes tes questions sur les forum dédiés au langage pascal et à lazarus entre autres Cordialement Jérôme ---------------------------------------------------------------------- BeanzMaster · 2018-10-17 14:17 Pour ce qui est de ton problème il faudrait en dire un peu plus, car il y existe plusieurs manières de lire un fichier. Comme http://wiki.freepascal.org/File_Handling_In_Pascal ou encore avec les "flux" https://www.freepascal.org/docs-html/rtl/classes/tstream.html ou bien encore tu peux passer pas un objet TStrings http://wiki.freepascal.org/TStringList-TStrings_Tutorial A bientôt ---------------------------------------------------------------------- Gilles · 2018-10-17 14:53 AH merci, ça y est, je comprends l'anglais  je développe en Pascal pur, sur XCode Lazarus, c'est du orienté objet, et je n'ai jamais vraiment regardé comment ça marchait. ---------------------------------------------------------------------- Gilles · 2018-10-17 16:02 GillesS sur  https://lazarus.developpez.com ---------------------------------------------------------------------- valdir.marcos · 2018-10-18 01:32 Quote from: BeanzMaster on October 17, 2018, 04:12:45 pmBonjour Gilles, je te suggère de venir sur https://lazarus.developpez.com la communauté française pour Lazarus. Tu y trouvera de très bon tutoriel sur le langage pascal et sur l'utilisation de Lazarus. Et ce sera avec plaisir que nous t'aiderons. N'hésites donc pas à t'inscrire et poser toutes tes questions sur les forum dédiés au langage pascal et à lazarus entre autres.Merci.