Successfully reported this slideshow.
Upcoming SlideShare
×

# 04 meme script

688 views

Published on

Meme IDE Training Material

• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

### 04 meme script

1. 1. Meme Script● Type System● If, while etc● Dates, times, strings
2. 2. Meme Script Examplevar x = 10;var y = 20;var z : Integer;z = x + y;notify(z);
3. 3. Meme IDE Function Editor
4. 4. Primitive Types● Integer 10, -234● Decimal 1.23● String “ABC”● Boolean true, false
5. 5. Declaring Integer Variables● Local variables within functionsvar x : Integer;var x2 = 1;
6. 6. Declaring Decimal Variablesvar d : Decimal(2);var d2 = 1.23;
7. 7. Declaring Boolean Variablesvar b : Boolean;var b2 = true;
8. 8. Declaring Stringsvar s : String;var s = “abc”;
9. 9. Default Initializations● String - empty string “”● Integer and Decimal – 0● Boolean – false
10. 10. Pre-defined Complex Types● Date – day, month, year● Time – hour, minute, second● Duration – hour, minute, second● Timestamp
11. 11. IFvar a = 15;if (a > 10){ notify(“A is big”);}
12. 12. IF / ELSEvar a = 15;if (a > 10){ notify(“A is big”);}else{ notify(“A is small”);}
13. 13. IF / ELSIF / ELSE notify(“A is small”);} notify(“A is big”);}elsif (a > 5){ notify(“A is medium sized”);}else{ notify(“A is small”);}
14. 14. WHILEvar x = 0;while (x < 10){ x++; // do other things}
15. 15. FORvar names : String[];append(names, "Jack");append(names, "Jill");append(names, "Jane");for (name in names){ notify(name);}
16. 16. Arithmeticvar c = 20;f = c * (9.0 / 5.0) + 32;notify(f);
17. 17. Logical Operatorsvar x = 10;if ((x > 10) and not (x > 20)){ notify(“x is middle sized”);}
18. 18. Dataspace
19. 19. Defining a Person Record
20. 20. Adding Attributes to the Person Record
21. 21. Naming ConventionsRecord Type Names● bumpy case with initial uppercase,● - E.g. Person or EmployeeDetailsAttribute names in records● - bumpy case with initial lowercase● - E.g. name or firstName
22. 22. Defining an Address Record
24. 24. Creating a Person Recordvar p : Person;var a : Address;a.line1 = "12 Hight St";a.zip = "PA 12345";p.name = "Simon";p.tel = "1234567";append(p.addresses, a);