-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Mastering the Nmap Scripting Engine
By :
Now we will cover other concepts in Lua. If you are familiar with other scripting languages, you will find this section very useful because it aims to get you familiar with topics such as comments, array indexes, semantics, and data types.
A comment can be anything between two hyphens and the end of the line:
--This is a comment
Comment blocks are also supported. They are delimited by the --[[ and ]] characters:
--[[ This is a multi-line comment block. ]]
There are occasions when you don't need all the information returned by a function; in Lua, you can use dummy assignments to discard a return value. The operator is _ (underscore). For example, in the following code line, we discard the first two return values of string.find and store only the third value:
local _, _, item = string.find(<string>, <pattern with capture>)
Indexes start at one, not zero:
z={"a","b","c"}
z[1]="b" --This assignment will change the content of the table...
Change the font size
Change margin width
Change background colour