Loading ...
Sorry, an error occurred while loading the content.
 

Re: Printing text files

Expand Messages
  • silberstein@abstraction.ch
    just a small suggestion completing the proposal of Manu. Under Windows 2000, but I beleave that it s valid for any NT version, you may have o more silent
    Message 1 of 5 , May 2, 2002
      just a small suggestion completing the proposal of Manu. Under Windows 2000,
      but I
      beleave that it's valid for any NT version, you may have o more silent
      version. If you do like Manu said, it's works but you see a terminal
      appearing on the top during the execution of your command. Thus a more
      transparent solution consists to start the command interpretor as following:

      cmd_prepend: STRING is
      once
      result := get("COMSPEC")
      if result /= void then
      result.prepend("start /MIN ")
      ----- The switch /B does not works !
      result.append (" /C ")
      else
      result := clone("")
      end
      end

      This start the command interpretor in icon state. The switch /B you could
      prevent to create a new windows does not works. If your are working under
      windows 9x, the prepend command is an emptax string. Then the system call is
      something like:

      system (s: STRING) is
      -- Pass to the operating system a request to execute
      `s'.
      -- If `s' is empty, use the default shell as command.
      local
      ext : ANY
      cmd: STRING
      do
      if s.empty then
      ext := default_shell.to_c
      else
      cmd := cmd_prepend + s
      ext := cmd.to_c
      end
      ....
      return_code := system_call ($ext)
      ....

      Hope this helps,
      Regards,
      Jacques


      On Tuesday 30 April 2002 11:34, you wrote:
      >
      >
      > To unsubscribe from this group, send an email to:
      > ise_users-unsubscribe@yahoogroups.com
      >
      >
      > ------------------------------------------------------------------------
      >
      > There are 2 messages in this issue.
      >
      > Topics in this digest:
      >
      > 1. Printing text files
      > From: "dlangley78" <dale.langley@...>
      > 2. RE: Printing text files
      > From: "Emmanuel STAPF [ISE]" <manus@...>
      >
      >
      > ________________________________________________________________________
      > ________________________________________________________________________
      >
      > Message: 1
      > Date: Mon, 29 Apr 2002 19:09:32 -0000
      > From: "dlangley78" <dale.langley@...>
      > Subject: Printing text files
      >
      > Hi,
      >
      > Can anyone offer any advice on writing a print command (system
      > call?) to print a text file. I am using eiffel 5.1 on windows nt 4 &
      > xp. I have tried the following with no success:
      >
      > print_command : STRING
      >
      > print_command := ("copy ")
      > print_command.append_string(sys.current_working_directory)
      > print_command.append_string("\")
      > print_command.append_string(file_name)
      > print_command.append_string(" prn")
      > sys.system(print_command)
      >
      > and
      >
      > print_command := ("print ")
      > print_command.append_string(sys.current_working_directory)
      > print_command.append_string("\")
      > print_command.append_string(file_name)
      > sys.system(print_command)
      >
      > Thank you,
      >
      > Dale Langley (Student at UCN, UK)
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.