Thread: Help I'm stuck

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    2
    Rep Power
    0

    Exclamation Help I'm stuck


    Hi I am trying to modify a program used for msg transfer, once the msg is transfered I then have the option to delete the original msg. this is what I have.....

    procedure TMainForm.DeleteMessage_ButtonClick(Sender: TObject);
    var
    fullname:string[255];
    msgtxt:array [0..254] of char;
    response:Word;

    begin
    fullname:=Message_Directory + '\' + message_name;

    if not message_transferred then
    begin
    StrFmt(msgtxt,'You must transfer the message to at least one target before the message can be deleted',[fullname]);
    MessageDlg(msgtxt,mtWarning,[mbOK],0);
    exit;
    end;
    response:=MessageDlg('Are you sure you want to delete this message?',
    mtConfirmation,mbOkCancel,0);
    if (response = mrCancel) then
    exit;
    if not DeleteFile(fullname)then
    begin
    StrFmt(msgtxt,'DeleteFile failed for ''%s''',[fullname]);
    MessageDlg(msgtxt,mtWarning,[mbOK],0);
    end;

    MainMemo.Lines.SaveToFile(Archive_Directory + '\' + message_name);
    MainMemo.Clear;
    if Files_ComboBox_Update then
    Files_ComboBox.Text:='No Message Selected'
    else
    Files_ComboBox.Text:='No Messages Present';
    Enable_Controls(false);
    end;


    The line in red is not right but I just cant see what is wrong (must be old age) any help would be great..

    thanks

    Ken
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    Space between then and begin perhaps?
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    2
    Rep Power
    0
    Originally Posted by Scorpions4ever
    Space between then and begin perhaps?
    Sorry that was the way I typed the msg the "begin" is on a new line.

    Thanks anyway

    Ken

IMN logo majestic logo threadwatch logo seochat tools logo