Tampilkan postingan dengan label string. Tampilkan semua postingan
Tampilkan postingan dengan label string. Tampilkan semua postingan

Taking Random Values in Corona

Posted by Unknown Rabu, 06 November 2013 0 komentar
Syntax for taking random numbers or values in corona has been given below.
Download the code and try it...

Syntax
        math.random() 
        math.random( m ) 
        math.random( m, n )

math.random() ---> a number between 0 and 1
math.random(m) ---> an integer between 1 and n (inclusive)
math.random(m,n) ---> an integer between m and n (inclusive)
 

math.random() ---> a number between 0 and 1
math.random(20) ---> an integer between 1 and 20 (inclusive)
math.random(20, 40) ---> an integer between 20 and 40 (inclusive)


Baca Selengkapnya ....

Using For Loops inCorona

Posted by Unknown Selasa, 05 November 2013 0 komentar
Using For Loops in corona is very eazy.Copy and try the code below..
 
for i=1,20 do
print(i)
end

Baca Selengkapnya ....

String Functions In Corona

Posted by Unknown Sabtu, 02 November 2013 0 komentar
Here is a list of string function which are very useful...

string.byte() Returns the internal numerical codes of the characters in a string.
string.char()Returns a string in which each character has the internal numerical code equal to its corresponding argument.
string.find() Looks for the first match of a pattern in a string. If found, it returns the indices where the occurrence starts and ends; otherwise, returns nil.
string.format()Returns a formatted string following the description given in its arguments.
string.gmatch()Returns a pattern-finding iterator.
string.gsub()Replaces all occurrences of a pattern in a string.
string.len()Returns the length of a string (number of characters).
string.lower()Changes uppercase characters in a string to lowercase.
string.match()Extracts substrings by matching patterns in a string.
string.rep()Replicates a string by returning a string that is the concatenation of n copies of a specified string.
string.reverse()Reverses a string.
string.sub()Returns a substring (a specified portion of an existing string).
string.upper()Changes lowercase characters in a string to uppercase.

Baca Selengkapnya ....

Android using Bundle for sharing variables

Posted by Unknown Jumat, 20 September 2013 0 komentar
Sharing variables between Activities is quite important point during development time of your Application. This  Example suppose Activity1 from where you run up other Activity2 .  
We gonna share variable myValue.

In Activity1 :
myValue="string values";
Intent intent = new Intent(MainActivity.this,NewClass.class);
Bundle bundle = new Bundle();
bundle.putString("myValue", myValue);
intent.putExtras(bundle);
startActivity(intent);
or

Intent intent = new Intent(MainActivity.this,NewClass.class);
intent.putExtra("myValue",AnyValue);
startActivity(intent);

In Activity2 :
Bundle bundle = getIntent().getExtras();
String value= bundle.getString(“myValue“);
or

Intent intent=getIntent();
Bundle bundle=intent.getExtras();
String value= bundle.getString(“myValue“);

Baca Selengkapnya ....

Types and Values In Corona

Posted by Unknown Kamis, 22 Agustus 2013 0 komentar
Lua is a dynamically typed language. This means that variables do not have types; only values do. There are no type definitions in the language. All values carry their own type.
All values in Lua are first-class values. This means that all values can be stored in variables, passed as arguments to other functions, and returned as results.
nil — it usually represents the absence of a useful value.
boolean
 — represents two conditions 'false' or 'true'
number
 — represents real (double-precision floating-point) numbers.
string
 — represents arrays of characters. Lua is 8-bit clean: strings can contain any 8-bit character,   including embedded zeros.
function 
click here to get more details
table
 — the sole data structuring mechanism in Lua.

Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.