Results 1 to 3 of 3

Thread: Simba and SQLITE and cmd

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Simba and SQLITE and cmd

    Hi,

    Two Questions:

    A) Can we use sqlite in simba and how ? (extension??)
    B) Is there an simba plugin to run cmd commands or exe files ?

    Thanks in advance D

  2. #2
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Simba Code:
    openwebpage('path/to/batch/file');

    That works, or, i forget the method, but there is a type that is a console that allows you to send commands and receive the output from them.

  3. #3
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Simba Code:
    function ExecuteCommand(cmd:String; storeOutput:Boolean=False): string;
    var
      rc, f:Int32;
      b:Char;
      name,stream:string;
      proc:TProcess;
    begin
      proc.Init(nil);
      proc.SetCommandLine(cmd);
      proc.SetOptions([poUsePipes, poStderrToOutPut]);
      proc.Execute();

      stream := '';
      rc = 1;
      repeat
        repeat
          rc := proc.GetOutput().Read(b,1);
          stream += b;
        until (b = #10) or (rc = 0);

        if (stream <> '') then
        begin
          WriteLn(Replace(stream, #13#10,'',[]));
          if storeOutput then Result += stream;
          stream := '';
        end;
      until (rc = 0) and not(proc.GetRunning());
      proc.Free();
    end;


    begin
      ExecuteCommand('ping google.com -n 5');
    end.


    as for sqllite support there are currently no plugins for it, you can write wrappers yourself for the dll if you use Simba 1.2+
    !No priv. messages please

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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