help me to read a file from other file .
please modify files below :
---- file2 (for cal file1) ww=1 require "file1" print(456*a)
----- file1
a=input("a ?")
if ww==1 then
return a
else print(3*a)
end
					
					 
	 
					
				
				
				
					
				
			
				
			Posted 23 September 2013 - 11:34 AM
---- file2 (for cal file1) ww=1 require "file1" print(456*a)
----- file1
a=input("a ?")
if ww==1 then
return a
else print(3*a)
end
					
					 
					
				
				
				
					
				
			
				
			Posted 24 March 2014 - 11:05 AM
---- file2 (for cal file1)
ww=1
a = doscript("file1", {ww=ww})
print(456*a)
----- file1
a=input("a ?")
if args.ww==1 then
return a
else
return 3*a
end
for k,v in pairs(args) do _G[k] = v endThis will extract the variables from args and will put it in Lua's 'global table'.
---- file2 (for cal file1)
require("file1")
ww=1
a = GetInput(ww)
print(456*a)
----- file1
function GetInput(w)
a=input("a ?")
if w==1 then
return a
else
return 3*a
end
end
export { GetInput = GetInput }
0 members, 1 guests, 0 anonymous users