Andromo - Start Making Apps - Free Signup

Announcement

Collapse
No announcement yet.

Cannot Write (table value) to Log File

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot Write (table value) to Log File

    When trying to write information to a log file I receive the following message

    "Attempt to call global 'user_info' (a table value)"

    user_info = System.GetUserInfo();
    SetupData.WriteToLogFile("Computer USERinfo: ",user_info"\r\n",true);

    I have also tried

    SetupData.WriteToLogFile("Computer USERinfo: ",System.GetUserInfo()"\r\n",true);

    I also have another area with the same problem

    SetupData.WriteToLogFile("UserName: ",CTRL_EDIT_01"\r\n",true);
    SetupData.WriteToLogFile("UserCompany: ",CTRL_EDIT_02"\r\n",true);

    Please Help

  • #2
    Take a look at the Setup Factory 7.0 Help File for the full syntax and examples, but the problem is that System.GetUserInfo returns a table of information, rather than a single value.

    table System.GetUserInfo ()

    Example:
    Code:
    -- Checks to see if the current user is logged in with administrator permissions 
    -- and if they are not, displays a dialog box informing them.
    user_info = System.GetUserInfo();
    if (not user_info.IsAdmin) then
        Dialog.Message("Warning", "You are not logged in with the appropriate permissions.");
    end
    In this example, the registered user and organization could be accessed by referencing user_info.RegOwner and user_info.RegOrganization.
    AutoPlay Media Studio 8.5 is Windows 10 compatible today!

    Comment


    • #3
      Writing to log files

      I was able to get the user input to write to logs file but not able to get a table to to write to the logs. Below is the code I used for the user input screens

      sUserName=SessionVar.Expand("%UserName%");
      sMessage="UserName: "..sUserName.."\r\n";
      SetupData.WriteToLogFile(sMessage, true);

      sUserCompany = SessionVar.Expand("%UserCompany%");
      sMessage = "UserCompany: "..sUserCompany.."\r\n";
      SetupData.WriteToLogFile(sMessage, true);

      I still would like to get system.getlaninfo to write to the same log file.

      Comment


      • #4
        Originally posted by DarrellBlack
        still would like to get system.getlaninfo to write to the same log file.
        If you want to log the IP:
        Code:
        tLAN = System.GetLANInfo();
        SetupData.WriteToLogFile("IP: "..tLAN.IP.."\r\n", true);
        If you want to log all the information in the table:
        Code:
        for index, data in tLAN do
        	SetupData.WriteToLogFile(index..": "..data.."\r\n", false);
        end
        (false = without the time stamp.)

        The table feature is powerful, but at first glance it seems to be difficult. I recommend the SpeedyTraining CD #3 (or; at least; the free online video at http://www.speedytraining.com).

        Don't forget: There's a lot of action scripting stuff in the AMS50 forum.

        Good luck!
        Last edited by csd214; 02-07-2005, 12:24 AM.

        Comment

        Working...
        X