mirror of
https://onedev.site.tesses.net/crosslang/crosslang-tutorials
synced 2026-02-08 09:05:47 +00:00
First commit
This commit is contained in:
10
1 Our first project/cross.json
Normal file
10
1 Our first project/cross.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"info": {
|
||||
"description": "Change Me",
|
||||
"short_name": "changeme",
|
||||
"short_name_pretty": "Change Me",
|
||||
"type": "console"
|
||||
},
|
||||
"name": "MyFirstCrossLangApp",
|
||||
"version": "1.0.0.0-prod"
|
||||
}
|
||||
35
1 Our first project/src/main.tcross
Normal file
35
1 Our first project/src/main.tcross
Normal file
@@ -0,0 +1,35 @@
|
||||
func aFunctionWithOptionalArgument(a,$b)
|
||||
{
|
||||
Console.WriteLine(a);
|
||||
|
||||
if(TypeIsDefined(b))
|
||||
{
|
||||
Console.WriteLine(b);
|
||||
}
|
||||
else {
|
||||
Console.WriteLine("B is not defined");
|
||||
}
|
||||
}
|
||||
|
||||
func String.Join(join, $$strings)
|
||||
{
|
||||
var first=true
|
||||
var output = "";
|
||||
each(var item : strings)
|
||||
{
|
||||
if(!first)
|
||||
output +=join;
|
||||
first=false;
|
||||
output += item;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
func main(args)
|
||||
{
|
||||
//aFunctionWithOptionalArgument("A string");
|
||||
//aFunctionWithOptionalArgument(true, 42);
|
||||
|
||||
|
||||
Console.WriteLine(String.Join(".","192","168","0","142"));
|
||||
}
|
||||
Reference in New Issue
Block a user