-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntry.java
More file actions
58 lines (49 loc) · 2.37 KB
/
Entry.java
File metadata and controls
58 lines (49 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// *******************************************************************************
// * File: Entry.java *
// * Target: Consumer Perfect-Developer-generated Java projects that need a *
// * program entry point. *
// * Author: Escher Technologies Ltd. *
// * Desc: This file contains the Java stub that calls the Perfect Developer *
// * generated program entry point, handling any exceptions etc. that *
// * may result. *
// * Notes: Change the package name (see immediately below this header) to *
// * reflect the target package name specified in the Perfect Developer *
// * project (i.e. the user-chosen target package name). *
// *******************************************************************************
// Change this package name to match the one you have specified
// in the Code Generation options of the Perfect Developer project
package cas;
import java.io.IOException;
import java.io.File;
import Ertsys.*;
public final class Entry
{
public static void main(String jargs[])
{
//-----------------------------------------------------------------------------------
// Parse arguments - note that the path to the 'running' class file is not available,
// so the best we can do is provide the directory where the JVM was started
//-----------------------------------------------------------------------------------
String pathToClass = System.getProperty("user.dir");
if (pathToClass.length() != 0 && pathToClass.charAt(pathToClass.length() - 1) != File.separatorChar)
{
pathToClass = pathToClass + File.separatorChar;
}
Environment context = new Environment(pathToClass);
_eSeq pargs = new _eSeq(_eSystem._lString(pathToClass));
for (int i=0; i<jargs.length; i++)
{
pargs = pargs.append(_eSystem._lString(jargs[i]));
}
// Create an object to hold the return code
_eWrapper_int wrappedRetval = new _eWrapper_int(0);
// Execute the Perfect-generated user main ...
_jMain.main(context, pargs, (_eSeq) null, (char) 0, wrappedRetval);
// Terminate JVM with specified error level
System.exit(wrappedRetval.value);
//***************
//* End of MAIN *
//***************
}
}
// End