[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[m8n] Running samples on desktop

  1. Install Lua Studio for desktop (e.g. Jit or normal version is OK)
  2. Download snapshot (s8.snapshot.lua) and LuaStudio API library files in "C:/m8n/"
  3. Create new project m8n
  4. Copy the following contents as main.lua and Press RUN button to start the system
m8n="C:/m8n/"
dofile(m8n.."s8.snapshot.lua")
dofile(m8n.."LuaStudio.st.lua")
dofile(m8n.."LuaStudioSamples.st.lua")

print(("'3+4=',(3+4)"):evaluate())

code=[[
	self print: 'Lib sys version=',Lib sys version!

#("Uncomment to run sample:
	Crypto Bytes Http EReg Json SQLight
	SSL Utf8 VM Loader
	Stage3D AGALMiniAssembler GLSLFragmentShader
	MediaFile Timer Accelerometer 
"	) do: [:each| (Smalltalk at: each) example ]!

]]
code:fileIn()

In case you want to run a sample evaluating directly from swiki page the code can be
-- Code for main.lua to run code embedded in a page of the s8-media swiki
-- Note that this code will load snapshot and frameworks from local
-- folder in your device, so it is required a folder at /m8n/
-- containing the files that can be downloaded from U8 service
local m8n = Lib.Media.FileSystem.File.documentsDirectory.nativePath.."/m8n/"
--m8n="C:/C/lua/m8n/"

dofile(m8n.."s8.snapshot.lua")
dofile(m8n.."LuaStudio.st.lua")
dofile(m8n.."LuaStudioSamples.st.lua")
dofile(m8n.."swiki.st.lua")
dofile(m8n.."swikiStudio.st.lua")

print(("'3+4=',(3+4)"):evaluate())

code=[[
	self print: 'Lib sys version=',Lib sys version!

	SwikiCodeRobot @> 716 "evaluate the code in swiki page number 716"!

]]
code:fileIn()