Help please. Delphi Newbie

From: JLC (JLC_at_JLC.COM)
Date: 09/29/04


Date: Tue, 28 Sep 2004 23:31:13 GMT

I'm just a guy self-learning delphi. And yes my delphi for dummies is
actually on its way :)
I'm slowly converting a VB app I wrote to delphi.

But what's wrong with the following code?
"appinifile" will contain the correct path and filename but then the
if statement is skipped and "appinifile" is nil.
putting the path as a literal( 'path\fname') works but
not using the variable. Though I see it used in examples.

unit sdmian;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
  Dialogs, StdCtrls, ExtCtrls, Buttons, Grids, DBGrids, inifile;

type
  TForm1 = class(TForm)
    Process_Label: TLabel;
    Diskspace_Label: TLabel;
    Process_Timer_label: TLabel;
    Timer1: TTimer;
    About_button: TButton;
    Help_button: TButton;
    Button_panel1: TPanel;
    Start_button: TButton;
    Search_button: TButton;
    Shape1: TShape;
    Expandlistbox_button: TButton;
    ListBox1: TListBox;
    DBGrid1: TDBGrid;
    autostart_checkbox: TCheckBox;
    end_button: TButton;
    Abort_button: TButton;
    Button1: TButton;
    Msg_label: TLabel;
    Feedback_label: TLabel;
    Bevel1: TBevel;
    RARdelete_checkbox: TCheckBox;
    procedure FormCreate(Sender: TObject);
    
end;
var
  Form1 :TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
   appinifile : string;

begin
   appinifile := extractFilepath(Application.exename) + 'SDLite.ini';
   if not (FileExists(appinifile)) then begin
      createinifile;
    end;
 end;
end.


Quantcast