-
Notifications
You must be signed in to change notification settings - Fork 5
/
run.smr
executable file
·64 lines (52 loc) · 1.65 KB
/
run.smr
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
59
60
61
62
63
#!/Library/WebServer/Documents/builder/bin/Simgua
#include("SimguaModelCreator.smr")
dim i as integer
dim m as model = SimguaModelCreator.CreateModel(options.value("Model"), false)
dim r as results = m.runSilently()
write "SUCCESS"
if r.errorCount>0 then
write "ERROR<ul>"
for i=0 to r.errorCount-1
if (r.error(i).myPrimitive<>nil) then
write "<li>"+r.error(i).errorMessage+" - In the primitive '"+r.error(i).myPrimitive.name+"'.</li>"
else
write "<li>"+r.error(i).errorMessage+"</li>"
end if
next
write "</ul>"
else
dim primitives() as primitive = m.root.flatten
dim rootDisplay as display
for i=0 to primitives.ubound
if primitives(i) isa display then
rootDisplay = display(primitives(i))
end if
next
//dim resID as string = hex(rnd*1000000)
//dim resFolder as folderitem = new Folderitem
//resFolder = resFolder.child(resID)
//call resFolder.CreateAsDirectory
//dim displayNames() as string
//dim tables() as string
//for i=0 to primitives.ubound
// if primitives(i) isa display then
// displayNames.append display(primitives(i)).type
// displayNames.append primitives(i).name
// tables.append r.DisplayCSV(display(primitives(i)))
// end if
//next
//write resID+chr(10)+"<sfrdiv>"+chr(10)
//write displayNames.join("/")+chr(10)+"<sfrdiv>"+chr(10)
//write escapeentities(r.console)+chr(10)+"<sfrdiv>"+chr(10)
//write tables.join(chr(10)+"<sfrdiv>"+chr(10))
dim itemNames() as string
for i=0 to rootDisplay.count()-1
itemNames.append(rootDisplay.item(i).info)
next
write "<SFRDIV>"
write itemNames.join(",")
write "<SFRDIV>"
write r.DisplayCSV(rootDisplay)
write "<SFRDIV>"
write escapeentities(r.console)
end if