From: John L. <jr...@us...> - 2006-12-19 17:06:24
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14743/wxLua/docs Modified Files: wxlua.html Log Message: update docs Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxlua.html 8 Dec 2006 23:12:15 -0000 1.10 --- wxlua.html 19 Dec 2006 17:06:16 -0000 1.11 *************** *** 20,24 **** language wrapper around the <a href="http://www.wxwidgets.org">wxWidgets</a> cross-platform GU ! I library. It consists of two IDE editors, an executable for running standalone wxLua scripts, and a library for extending C++ programs with a fast, small, --- 20,25 ---- language wrapper around the <a href="http://www.wxwidgets.org">wxWidgets</a> cross-platform GU ! I library. It consists of two IDE type editors, an executable for ! running standalone wxLua scripts, and a library for extending C++ programs with a fast, small, *************** *** 116,120 **** <li>Line comments are marked by --</li> ! <li>Block Comments are --[[ multiple line comment ]]</li> </ul> --- 117,121 ---- <li>Line comments are marked by --</li> ! <li>Block Comments are <i>--[[ multiple line comment ]]</i></li> </ul> *************** *** 149,153 **** <ul> ! <li>Note: "a = 0; if a then print(a) end" evaluates "a" to true since it has a value, eg. not nil.</li> --- 150,155 ---- <ul> ! <li>Note: <i>"a = 0; if a then print(a) end"</i> ! evaluates "a" to true since it has a value, eg. not nil.</li> *************** *** 163,167 **** <ul> ! <li>mynumber = (1+ 2 * 3 / (4 * 1) )*math.pow(2, 4)</li> </ul> --- 165,169 ---- <ul> ! <li><i>mynumber = (1+ 2 * 3 / (4 * 1) )*math.pow(2, 4)</i></li> </ul> *************** *** 172,179 **** <ul> ! <li>mystring = "How are 'you'!" or mystring = 'How ! are\t"You"!\n' are both valid</li> ! <li>mystring = [[How are "'you'"!]] means take everything including new lines and whitespace literally.</li> --- 174,183 ---- <ul> ! <li><i>mystring = "How are 'you'!"</i> or <i>mystring ! = 'How ! are\t"You"!\n'</i> are both valid</li> ! <li><i>mystring = [[How are "'you'"!]]</i> ! means take everything including new lines and whitespace literally.</li> *************** *** 182,187 **** <ul> ! <li>str1 = "hello"; str2 = "number"; str3 = str1.." ! "..str2.." "..tostring(2).."!"</li> </ul> --- 186,192 ---- <ul> ! <li><i>str1 = "hello"; str2 = "number"; str3 = ! str1.." ! "..str2.." "..tostring(2).."!"</i></li> </ul> *************** *** 194,213 **** <ul> ! <li>mytable = {} a default empty table, must declare table variable before using it's indexes.</li> ! <li>mytable = { ["index1"] = 1, "first value", "second ! value", ["index2"] = 2 }</li> <ul> ! <li>print(mytable.index1, mytable["index1"], mytable[1], ! mytable[2], mytable.index2, mytable.index10)</li> <li>Outputs this : "1, 1, first value, second value, 2, nil"</li> ! <li>Set values as : mytable.index1 = 2; ! mytable["index10"] = 3; mytable[10] = 4</li> <li>New values that don't already exist are automatically --- 199,221 ---- <ul> ! <li><i>mytable = {}</i> a default empty table, ! must declare table variable before using it's indexes.</li> ! <li><i>mytable = { ["index1"] = 1, "first value", ! "second ! value", ["index2"] = 2 }</i></li> <ul> ! <li><i>print(mytable.index1, mytable["index1"], ! mytable[1], ! mytable[2], mytable.index2, mytable.index10)</i></li> <li>Outputs this : "1, 1, first value, second value, 2, nil"</li> ! <li>Set values as : <i>mytable.index1 = 2; ! mytable["index10"] = 3; mytable[10] = 4</i></li> <li>New values that don't already exist are automatically *************** *** 217,220 **** --- 225,232 ---- = nil</li> + <li>The length operator <i>#mytable</i> + returns 2 since there are only two contiguous numeric table indexes + starting from 1.</li> + </ul> *************** *** 230,233 **** --- 242,254 ---- table "namespace".</li> + <li>The global table is called _G and you can display it + or any table using </li> + + <ul> + + <li><i>for k, v in pairs(_G) do print(k, v) end</i></li> + + </ul> + </ul> *************** *** 238,242 **** <ul> ! <li>Variables can be assigned to functions if desired.</li> </ul> --- 259,288 ---- <ul> ! <li><i>function SumDiff(num1, num2) print(num1, ! num2); ! return num1+num2, num1-num2 end</i></li> ! ! <ul> ! ! <li><i>num_sum, num_diff = SumDiff(2, 3)</i></li> ! ! </ul> ! ! <li>Can return multiple values and be passed less variables ! than specified. The unhandled returns or inputs are set to ! nil. </li> ! ! <li>Variables can be assigned to functions if desired or ! functions can be put into tables</li> ! ! <ul> ! ! <li><i>PrintWarning = function(msg) print("Warning: ! "..msg) end</i></li> ! ! <li><i>FuncTable = {}; FuncTable["Warning"] = ! PrintWarning; FuncTable.Warning("I'm broke")</i></li> ! ! </ul> </ul> *************** *** 244,251 **** <ul> ! <li>Can return multiple values</li> ! ! <li>Values cannot be returned through input variables ! unless they are tables</li> </ul> --- 290,295 ---- <ul> ! <li>Values passed to functions are local and not ! modified unless they are tables</li> </ul> *************** *** 253,258 **** <ul> ! <li>function DoStuff(input1, input2) print(input2, input2); ! return input1+input2, input1 end</li> </ul> --- 297,312 ---- <ul> ! <ul> ! ! <li><i>function AppendToTable(atable, val) ! atable[#atable+1] = val end</i></li> ! ! <li><i>mytable = {}; AppendToTable(mytable, "hello")</i> ! adds "hello" to index 1, eg. mytable[1] == "hello"</li> ! ! <li>Note that the table is not returned, but modified ! inplace.</li> ! ! </ul> </ul> *************** *** 1106,1109 **** --- 1160,1165 ---- nice editor using the wxStyledTextCtrl.</li> + <li>The lua code for it is in samples/editor.wx.lua</li> + <li>You can fully debug lua programs, step through them line by *************** *** 1214,1218 **** <li>This is the same table the lua executable ! creates, where 0 = the name of the lua program run and positive indices are args to the lua program and the most negative index is the name of the executable.</li> --- 1270,1275 ---- <li>This is the same table the lua executable ! creates, where arg[0] is the name of the lua program run and positive ! indices are args to the lua program and the most negative index is the name of the executable.</li> *************** *** 1328,1332 **** </ul> ! <h2><u>wxLua Modules</u></h2> wxLua is broken up into "modules" that are compiled into libraries so --- 1385,1389 ---- </ul> ! <h2><u>wxLua Sourcecode Modules</u></h2> wxLua is broken up into "modules" that are compiled into libraries so *************** *** 1425,1430 **** <h2><u>wxLua Programming in C++</u></h2> ! The documentation for the wxLua library is in the header files above ! each function, enum, etc. Please read through them to get a feel for what functions wxLua provides, but note that most of them are for internal use and are not generally useful. Below is just a quick --- 1482,1488 ---- <h2><u>wxLua Programming in C++</u></h2> ! The documentation for the wxLua library is in the header files and ! descriptions are given for each function, enum, etc. Please ! read through them to get a feel for what functions wxLua provides, but note that most of them are for internal use and are not generally useful. Below is just a quick |