1. <GALiRe font:verdana;fontsize:10;> 2. 3. <title>GScript and AScript Equalization<end title> 4. 5. <table border:1;padding:5;spacing:0;width:700;> 6. <row> 7. <cell> 8. <?AScript 9. 10. @myArray=("happy","sad",2,"done"); 11. $good="andrea"; 12. add("allison") to(@myArray); 13. add("$good and stuff") to(@myArray); 14. print("myArray contains: @myArray<new>"); 15. remove(3) from(@myArray); 16. print("After removing index #3, myArray now contains: @myArray"); 17. 18. $len=lengthOf($good); 19. print("<new><new>The length of \"andrea\" is: $len"); 20. 21. ?> 22. <end cell> 23. <end row> 24. 25. 26. <row> 27. <cell> 28. <? 29. 30. @myArray=("happy","sad",2,"done"); 31. $good="andrea"; 32. add("allison") to(@myArray); 33. add("$good and stuff") to(@myArray); 34. print("myArray contains: @myArray<new>"); 35. remove(3) from(@myArray); 36. print("After removing index \#3, myArray now contains: @myArray"); 37. 38. $len=lengthOf($good); 39. print("<new><new>The length of \"andrea\" is: $len"); 40. 41. ?> 42. <end cell> 43. <end row> 44. <end table> 45. 46. 47. <new><new><new> 48. 49. 50. <table border:1;padding:5;spacing:0;width:700;> 51. <row> 52. <cell> 53. <?AScript 54. 55. $var1="happy "; 56. $index=lastIndexOf("p") in($var1); 57. print("Last index of 'p' in happy is: $index"); 58. 59. print("<new>"); 60. 61. $var1="happy "; 62. $index=indexOf("p") in($var1); 63. print("Index of 'p' in happy is: $index"); 64. 65. ?> 66. <end cell> 67. <end row> 68. 69. 70. <row> 71. <cell> 72. <?GScript 73. 74. $var1="happy "; 75. $index=lastIndexOf("p") in($var1); 76. print("Last index of 'p' in happy is: $index"); 77. 78. print("<new>"); 79. 80. $var1="happy "; 81. $index=indexOf("p") in($var1); 82. print("Index of 'p' in happy is: $index"); 83. 84. ?> 85. <end cell> 86. <end row> 87. <end table> 88. 89. 90. <new><new><new> 91. 92. 93. <table border:1;padding:5;spacing:0;width:700;> 94. <row> 95. <cell> 96. <?AScript 97. 98. @myArray=(5,10,196,530,69); 99. $var1=solve(lengthof("5")+1); 100. print("@myArray <new><new>"); 101. $removed = remove($var1) from(@myArray); 102. print("$removed"); 103. print "<new><new>@myArray"; 104. 105. ?> 106. <end cell> 107. <end row> 108. 109. 110. <row> 111. <cell> 112. <?GScript 113. 114. @myArray=(5,10,196,530,69); 115. $var1=solve(lengthof("5")+1); 116. print("@myArray <new><new>"); 117. $removed = remove($var1) from(@myArray); 118. print("$removed"); 119. print "<new><new>@myArray"; 120. 121. ?> 122. <end cell> 123. <end row> 124. <end table> 125. 126. 127. <new><new><new> 128. 129. 130. <table border:1;padding:5;spacing:0;width:700;> 131. <row> 132. <cell> 133. <?AScript 134. @arry=("Florida","Allison","Andrea","love"); 135. @arry2=multiply(@arry) by(3); 136. print @arry2; 137. ?> 138. <end cell> 139. <end row> 140. 141. 142. <row> 143. <cell> 144. <?GScript 145. @arry=("Florida","Allison","Andrea","love"); 146. @arry2=duplicate(@arry,3x); 147. print @arry2; 148. ?> 149. <end cell> 150. <end row> 151. <end table> 152. 153. 154. <new><new><new> 155. 156. 157. <table border:1;padding:5;spacing:0;width:700;> 158. <row> 159. <cell> 160. <?AScript 161. @arry=("Florida","Allison","Andrea","love"); 162. print select(0-1) from(@arry) + "<new>"; 163. print select(0,1) from(@arry) + "<new>"; 164. 165. $goodness="Good things happen to bad people"; 166. print select(5-11) from($goodness) + "<new>"; 167. $goodness="Good things happen to bad people"; 168. print select(5,11) from($goodness); 169. ?> 170. <end cell> 171. <end row> 172. 173. 174. <row> 175. <cell> 176. <? 177. @arry=("Florida","Allison","Andrea","love"); 178. print select(0-1) from(@arry) + "<new>"; 179. print select(0,1) from(@arry) + "<new>"; 180. 181. $goodness="Good things happen to bad people"; 182. print select(5-11) from($goodness) + "<new>"; 183. $goodness="Good things happen to bad people"; 184. print select(5,11) from($goodness); 185. ?> 186. <end cell> 187. <end row> 188. <end table> 189. 190. 191. <new><new><new> 192. 193. 194. <table border:1;padding:5;spacing:0;width:700;> 195. <row> 196. <cell> 197. <?AScript 198. @arry=("Florida","Allison","Andrea","love"); 199. remove(0-1) from(@arry); 200. print "@arry<new>"; 201. 202. @arry=("Florida","Allison","Andrea","love"); 203. remove(0,1) from(@arry); 204. print "@arry<new><new>"; 205. 206. @arry=("Florida","Allison","Andrea","love"); 207. print remove(0-1) from(@arry) + "<new>"; 208. 209. @arry=("Florida","Allison","Andrea","love"); 210. print remove(0,1) from(@arry); 211. ?> 212. <end cell> 213. <end row> 214. 215. 216. <row> 217. <cell> 218. <? 219. @arry=("Florida","Allison","Andrea","love"); 220. remove(0-1) from(@arry); 221. print "@arry<new>"; 222. 223. @arry=("Florida","Allison","Andrea","love"); 224. remove(0,1) from(@arry); 225. print "@arry<new><new>"; 226. 227. @arry=("Florida","Allison","Andrea","love"); 228. print remove(0-1) from(@arry) + "<new>"; 229. 230. @arry=("Florida","Allison","Andrea","love"); 231. print remove(0,1) from(@arry); 232. ?> 233. <end cell> 234. <end row> 235. <end table> 236. 237. 238. <new><new><new> 239. 240. 241. <table border:1;padding:5;spacing:0;width:700;> 242. <row> 243. <cell> 244. <?AScript 245. $sum=0; 246. 247. $var1=0;while ($var1 < 3) {$var1++; 248. $var2=0;while ($var2 < 4) {$var2++; 249. 250. if (0) {print "&addNum(5)<new>";} 251. else if (0) { 252. 253. if (0) {print "&addNum(1)<new>";} 254. else if (0) {print "&addNum(2)<new>";} 255. else {print "&addNum(3)<new>";} 256. 257. } 258. else {print "&addNum(15)<new>";} 259. 260. 261. } 262. print "<new>"; 263. } 264. 265. print uc("geeze") + "dude!"; 266. 267. 268. method addNum($num1) { 269. $sum = solve($num1+$sum); 270. return $sum;} 271. 272. ?> 273. <end cell> 274. <end row> 275. 276. 277. <row> 278. <cell> 279. <?GScript 280. $sum=0; 281. 282. $var1=0;while ($var1 < 3) {$var1++; 283. $var2=0;while ($var2 < 4) {$var2++; 284. 285. if (0) {print "&addNum(5)<new>";} 286. else if (0) { 287. 288. if (0) {print "&addNum(1)<new>";} 289. else if (0) {print "&addNum(2)<new>";} 290. else {print "&addNum(3)<new>";} 291. 292. } 293. else {print "&addNum(15)<new>";} 294. 295. 296. } 297. print "<new>"; 298. } 299. 300. print uc("geeze") + "dude!"; 301. 302. 303. method addNum($num1) { 304. $sum = solve($num1+$sum); 305. return $sum;} 306. 307. ?> 308. <end cell> 309. <end row> 310. <end table> 311. 312. 313. 314. </GALiRe>
Back to /SampleHost/