Results 1 to 5 of 5

Thread: debug mode

  1. #1

    debug mode

    I want to enable a debug mode by adding a condtion to the target field in my shortcut. For example My shortcut might have the target
    "Project1.Exe -Debug". I then want my program to realise that I want debug mode enabled and switch a boolean to enable it. I'm sure it's relatively simple but Google is proving fruitless. Anyone?
    Isometric game development blog http://isoenginedev.blogspot.com/

  2. #2

    debug mode

    load delphi -> help -> delphi help -> (index) paramstr function



    Code:
    The following example beeps once for each ?¢_obeep?¢__ passed in on the command line. The example terminates the application if  ?¢_oexit?¢__ is passed in on the command line.
    
    procedure TForm1.FormCreate(Sender: TObject);
    
    var
      i: Integer;
      for i := 1 to ParamCount do
      begin
        if LowerCase(ParamStr(i)) = 'beep' then
          Beep
        else if LowerCase(ParamStr(i)) = 'exit' then
          Application.Terminate;
      end;
    end;

  3. #3

    debug mode

    Quote Originally Posted by tux
    load delphi -> help -> delphi help -> (index) paramstr function
    I think he wants to add the Compiler switch, not just know about the parameter.
    Something like:

    if paramstr(1)='debug' then {$DEFINE debug}
    (obviously not working)

    Btw i don't think it is possible. The compiler switches (and all compiler directives) are resolved at compile time so your executable don't know anything about it.
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  4. #4

    debug mode

    in that case, use an .inc file and define the debug in that, just include that in every source file

  5. #5

    debug mode

    Brilliant stuff Tux, works like a charm. Always wondered what ParamStr actually did. Alyways used it to get the file path for my exe and that was it. It's actually a pretty useful function. Thanks again
    Isometric game development blog http://isoenginedev.blogspot.com/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •