1. <GALiRe bgColor:Beige;font:verdana;>
2.
3. <title>Break GScript<end title>
4.
5. <form:breakGScript.gacp;method:get;name:testForm;>
6. <small>
7. Name: <textbox name:name;value:Cool Guy;font:verdana;maxlength:8;onblur:select(testForm[locale]);id:sappy;><new>
8. Locale: <textbox name:locale;value:North Pole;font:verdana;onfocus:select(self);><new>
9. <file name:upFile;font:verdana;><new>
10. Mailer Type: HTML<radio name:mailerType;value:HTML;> - Text <radio name:mailerType;value:text;checked:true;><new><new>
11. Has License: <checkbox name:hasLicense;value:true;><new><new>
12. Transportation Method: <menu name:method;onchange:alert('Value is now\: ' + valueof(self) );><option value:Car;>Car<end option><option value:Bus;>Bus<end option><end menu><new><new>
13. <button type:submit;value:Submit Upload;font:verdana;>
14. <end small>
15. <end form>
16.
17.
18. <? #document[galire]{bgcolor:#FFEEFF;};testForm[hasLicense]{checked:true;bgcolor:red;}; ?>
19.
20.
21. <line>
22.
23.
24. <small>
25.
26.
27. <?
28.
29. @mdAry((5,10,15,20),(25,30,35,40),(45,50,55,60),(65,70,75,80));
30.
31.
32. /* Or you can define them separately*/
33.
34. /* create(@mdAry);*/
35.
36. /* @mdAry[0] = (5,10,15,20);*/
37.
38. /* @mdAry[1] = (25,30,35,40);*/
39.
40. /* @mdAry[2] = (45,50,55,60);*/
41.
42. /* @mdAry[3] = (65,70,75,80);*/
43.
44. while (@level1 = @mdAry) {
45.
46. while ($level2 = @level1) {
47. print "$level2<new>";
48. }
49.
50. print "<new>";
51. }
52.
53.
54. print "The font for element sappy is " + #document[sappy]{font} + "<new><new>";
55.
56.
57. @cheapTrick=("artie","das",10,"allison");
58. %theCure=(x='howdy',letter="p");
59.
60.
61. @myArray=("happy","sad",2,"done");
62. $good="andrea";
63. add(@cheapTrick[3]) to(@myArray);
64. add("$good and stuff %theCure["x"]") to(@myArray);
65. print "@myArray<new>";
66. remove(3) from(@myArray);
67. print @myArray;
68.
69. $len=lengthOf($good);
70. print "<new><new>$len";
71.
72.
73.
74.
75. print "<line>";
76.
77.
78.
79.
80. $var1="y";
81. %myHash=(x=10,y=7,);
82. %myHash[$var1]--;
83. print(%myHash[$var1]);
84.
85.
86.
87.
88. print "<line>";
89.
90.
91.
92.
93. $var1="happy ";
94. $index=lastIndexOf(%theCure["letter"]) in($var1);
95. print("$index");
96.
97. print("<new>");
98.
99. $var1="happy ";
100. $index=indexOf("p") in($var1);
101. print("$index");
102.
103.
104.
105.
106. print "<line>";
107.
108.
109.
110.
111. @myArray=(5,10,196,530,69);
112. $var1=solve(lengthof(%theCure["letter"])+1);
113. print("@myArray <new><new>");
114. $removed = remove($var1) from(@myArray);
115. print("$removed");
116. print "<new><new>@myArray";
117.
118.
119.
120.
121. print "<line>";
122.
123.
124.
125.
126. @arry=("Florida","Allison","Andrea","love");
127. @arry2=duplicate(@arry,3x);
128. print @arry2;
129.
130.
131.
132.
133. print "<line>";
134.
135.
136.
137.
138. if (0) {
139. $text="when Harry Met Sally and harry died";
140. add("Last night, ") to($text)b;
141. print $text;
142. }
143. else if (0) {
144. $text="when Harry Met Sally and harry died";
145. print $text contains("met");
146. }
147. else if (0) {
148. @my("harry","sally","chicago","allison","fricago");
149. print (@my lacks("friago")) + "<new>";
150. add("floriduh") to(@my);
151. print indexof("ago") in (@my)+"<new>";
152. print @my;
153. }
154. else {if (1) {
155. %my(harry="dude",sally="chick",chicago="place",allison="REALLY hot");
156. print %my lacks("harry")+"<new>";
157. %output = replace("dude")ig with("man") in(%my);
158. print "valueof(%output)<new>";
159. }}
160.
161.
162.
163.
164. print "<line>";
165.
166.
167.
168.
169. @arry=("Florida","Allison","Andrea","love");
170. @arry2=select(0-1) from(@arry);
171. print "@arry2<new>";
172. @arry2=select(0,1) from(@arry);
173. print "@arry2<new>";
174.
175. $goodness="Good things happen to bad people";
176. print select(5-11) from($goodness);print "<new>";
177. $goodness="Good things happen to bad people";
178. print select(5,11) from($goodness);
179.
180.
181.
182.
183. print "<line>";
184.
185.
186.
187.
188. @arry=("Florida","Allison","Andrea","love");
189. remove(0-1) from(@arry);
190. print "@arry<new>";
191.
192. @arry=("Florida","Allison","Andrea","love");
193. remove(0,1) from(@arry);
194. print "@arry<new><new>";
195.
196. @arry=("Florida","Allison","Andrea","love");
197. print remove(0-1) from(@arry);print "<new>";
198.
199. @arry=("Florida","Allison","Andrea","love");
200. print remove(0,1) from(@arry);
201.
202.
203.
204.
205. print "<line>";
206.
207.
208.
209.
210. $sum=0;
211.
212. $var1=0;while ($var1 < 3) {$var1++;
213. $var2=0;while ($var2 < 4) {$var2++;
214.
215. if (0) {print "&addNum(5)<new>";}
216. else if (0) {
217.
218. if (0) {print "&addNum(1)<new>";}
219. else if (0) {print "&addNum(2)<new>";}
220. else {print "&addNum(3)<new>";}
221.
222. }
223. else {print "&addNum(15)<new>";}
224.
225.
226. }
227. print "<new>";
228. }
229.
230. print uc("geeze") + "dude!";
231.
232. method addNum($num1) {
233. $sum = solve($num1+$sum);
234. return $sum;}
235.
236.
237.
238.
239. print "<line>";
240.
241.
242.
243.
244. @my("harry","sally","chicago","allison","fricago");
245. $text="when Harry Met Sally and harry died";
246. print round(solve(length(split(join(@my) by("-")) by("-"))*(1/4)),1) + "<new>";
247. @splitted=split(join(@my) by("-")) by("-");
248. $jointed=join(split($text) by(" ")) by(":");
249. print "@splitted<new>";
250. print "$jointed<new>";
251.
252. print "<new>";
253.
254.
255. /* The above code is in GScript, but I inserted it with AScript below, too*/
256. print("<?AScript @my("harry","sally","chicago","allison","fricago");$text="when Harry Met Sally and harry died";print round(solve(length(split(join(@my) by("-")) by("-"))*(1/4))) to(1) + "<new>";@splitted=split(join(@my) by("-")) by("-");$jointed=join(split($text) by(" ")) by(":");print "@splitted<new>";print "$jointed<new>"; ?>");
257.
258.
259.
260.
261. print "<line>";
262.
263.
264.
265.
266. @my("harry","sally","chicago","allison","fricago");
267.
268. while ($vaar = replace("sally") with("suzie") in(@my)) {print "$vaar<new>";}
269.
270. /*Note that replace(1,1) with("suzie") in(@my) would have had the same effect*/
271. print "<new>";
272.
273.
274.
275.
276. /* Note from the results below that replace with in is NOT destructive*/
277. while ($vaar = select(0,2) from(@my)) {print "$vaar<new>";}
278. print "<new>";
279.
280.
281.
282. while ($vaar = remove(1-3) from(@my)) {print "$vaar<new>";}
283. print "<new>";
284.
285.
286.
287.
288. /* Note from the results below that remove from is destructive*/
289. while ($vaar = select(0,2) from(@my)) {print "$vaar<new>";}
290.
291. ?>
292. <end small>
293.
294.
295. <line>
296.
297.
298.
299.
300. <new><new><align:center;><link:&showSource('http://galire.globalaircraft.org/SampleHost/view-source.pl?file=breakGScript.gacp');underline:false;overline:true;><color:blue;bold:true;>View Source<end color><end link><end align>
301.
302. <? method showSource($URL) {
303. if (#SourceWindow isNotOpen) {
304. open($URL,"height:400;width:600;resizable:true;scrollbars:true;statusbar:true;") as(#SourceWindow);
305. #SourceWindow{defaultstatus:Child Window;};
306. }
307. else {alert("Source code already open!");focus(#SourceWindow);}
308. } ?>
309.
310. </GALiRe>
Back to /SampleHost/