Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help with a shop till Project

MiCR0MiCR0 Posts: 1Member
I need to be able to load the variables at the startup from an external file. And the protocal commands on how to edit these variables from within the external file whilst it the program is running. This is so that I can have the Items and the Costs of the items in a changeble format rather than having unchangable variables.

I also need to be able to Enter 2 peices of Information on a seperate form and have those bits of information sent back to the primary form.
i.e The User selects an Item, and a seperate Form comes up asking the user to type in the Weight of the Item in Kilograms and Grams. and it is then sent back to the main form displaying the Weight.

Comments

  • injektiloinjektilo Posts: 113Member
    [b][red]This message was edited by injektilo at 2004-10-4 4:45:22[/red][/b][hr]
    : I need to be able to load the variables at the startup from an external file. And the protocal commands on how to edit these variables from within the external file whilst it the program is running. This is so that I can have the Items and the Costs of the items in a changeble format rather than having unchangable variables.

    >>>>>>>>>>>>>>
    something like this maybe:

    [code]
    uses IniFiles;

    var
    F: TIniFile;
    VAR: string;
    FORMAT: string;
    begin
    F := TIniFile.Create('afilename.ini');
    try
    VAR := F.ReadString('VARS', 'VAR_1', '');
    FORMAT := F.ReadString('FORMATS', 'VAR_1', '');
    finally
    F.Free;
    end;
    end;
    [/code]



    : I also need to be able to Enter 2 peices of Information on a seperate form and have those bits of information sent back to the primary form.
    : i.e The User selects an Item, and a seperate Form comes up asking the user to type in the Weight of the Item in Kilograms and Grams. and it is then sent back to the main form displaying the Weight.
    :
    :

    add unit2 to the uses of unit1

    [code]
    unit Unit1;

    interface

    uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs;

    type
    TForm1 = class(TForm)
    private
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;

    uses
    Unit2;

    implementation

    {$R *.dfm}

    end.
    [/code]

    now you can access information on Form2 like so:

    [code]
    procedure TForm1.Button1Click(Sender: TObject);
    var
    W: Integer;
    begin
    W := StrToIntDef(Form2.edtWeight.Text, 0);
    end;
    [/code]



Sign In or Register to comment.