Using the File.Print

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • gekhator
    Forum Member
    • Jun 2005
    • 2

    Using the File.Print

    Hi
    I'm very new to this.
    I'm trying to use the print function i.e. in add action i have the following:

    -- print the specified file
    File.Print(string "Autoplay\\Docs\\prog3ect.doc");

    -- check to see if an error occurred
    error = Application.GetLastError();

    -- if an error occurred, display the error message
    if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    end

    The error message i get is: OnClick, line 2: attempt to call global 'string' (a table value)
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3967

    #2
    It looks like you were declaring a string

    In AMS you don't need to declare the variable, so try this:
    Code:
    File.Print("Autoplay\\Docs\\prog3ect.doc");
    Originally posted by gekhator
    Hi
    I'm very new to this.
    I'm trying to use the print function i.e. in add action i have the following:

    -- print the specified file
    File.Print(string "Autoplay\\Docs\\prog3ect.doc");

    -- check to see if an error occurred
    error = Application.GetLastError();

    -- if an error occurred, display the error message
    if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    end

    The error message i get is: OnClick, line 2: attempt to call global 'string' (a table value)

    Comment

    • Intrigued
      Indigo Rose Customer
      • Dec 2003
      • 6125

      #3
      Got to love that aspect of AMS 5, typeless!

      http://www.indigorose.com/webhelp/am..._Variables.htm (#2)

      Woot!
      Intrigued

      Comment

      • gekhator
        Forum Member
        • Jun 2005
        • 2

        #4
        File.Print

        Thanks for the prompt reply,

        I have removed the string from the variable, and the error message this time is:

        The specified file can't be found.

        File.Print(string "c:\absolute_path\prog3ect.doc");

        I've tried putting the absolute file name string inbetween the quotes (as above) to no avail.

        Thanks for your help

        Greg

        Comment

        • Intrigued
          Indigo Rose Customer
          • Dec 2003
          • 6125

          #5
          File.Print(string "c:\absolute_path\prog3ect.doc");

          You have to "escape" backslashes in AMS 5 Actions:

          File.Print("c:\\absolute_path\\prog3ect.doc");
          Intrigued

          Comment

          Working...
          X