Andromo - Start Making Apps - Free Signup



New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

Cannot Write (table value) to Log File

  • 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 ()

    -- 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.");
    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!


    • #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

      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.


      • #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:
        tLAN = System.GetLANInfo();
        SetupData.WriteToLogFile("IP: "..tLAN.IP.."\r\n", true);
        If you want to log all the information in the table:
        for index, data in tLAN do
        	SetupData.WriteToLogFile(index..": ""\r\n", false);
        (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

        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.