| 28 | |
| 29 | = Create Console Project = |
| 30 | |
| 31 | * In the solution outline, the very top node says "!MyCompany.!MyProject" |
| 32 | * Right click it and choose Add > Add New Project |
| 33 | * Choose Cobra > Console Project |
| 34 | * Give a name like "!MyCompany.!MyProject.Console" in the "Name:" field. |
| 35 | * Right click in the new project in the solution outline and choose "Set As Startup Project" |
| 36 | * Open Program.cobra in the solution outline and add "Console.readLine": |
| 37 | |
| 38 | {{{ |
| 39 | #!cobra |
| 40 | """ |
| 41 | Replace this text with a description of your program. |
| 42 | """ |
| 43 | |
| 44 | class Program |
| 45 | |
| 46 | def main |
| 47 | print 'Hello, world!' |
| 48 | Console.readLine # <--- add this |
| 49 | }}} |
| 50 | |
| 51 | = Copy the Core = |
| 52 | |
| 53 | I like to copy Cobra's core library to co-reside with my program. This insulates it from the environment. |
| 54 | |
| 55 | * Right click "MyCompany.MyProject.Console" and choose "Options" |
| 56 | * Choose "Compiler" |
| 57 | * Make sure "Embed Run Time" is unchecked |
| 58 | * Add "-copy-core" to the "Cobra Arguments:" |
| 59 | * Click "OK" |
| 60 | |
| 61 | = Run It = |
| 62 | |
| 63 | * Try running the project. |
| 64 | * If you get an error about System.Core, expand the References of the Console project in the solution outline, right click and choose "Delete". |