1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lua sharing data with batch files

Discussion in 'Support' started by Terry, Jan 20, 2014.

  1. Terry

    Joined:
    Jun 28, 2008
    Messages:
    6
    Likes Received:
    0
    I recently installed Take Command with Lua. I am new to Lua but have been using 4Dos, 4Nt, and Take Command since the mid-1980s. I have never used Lua, but I like what I see. My question is how do I share information, data, between Lua code and Take Command code? I have found os.getenv to get information from my operating system environment table. But I have not found a corresponding setenv or putenv. It seems to me that I can share information from Take Command to Lua script, but I cannot see how to get information back from Lua script to my original batch script. I am probably missing something obvious, but if someone can give me some guidance I will appreciate it.
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,057
    Likes Received:
    30
    winapi.setenv(name, value)?

    I have read that it only child processes see the new variable. I'd guess that that's not true if LUA is embedded, and that the current process's environment will be changed.
    Let us know.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,057
    Likes Received:
    30
    Rex, is TCC's LUA support extensible with "modules"? If so, and the OP is interested, I found a winapi.dll (module) supposedly for LUA 5.2.
     

Share This Page