1. <GALiRe bgColor:Beige;font:verdana;> 2. 3. <title>File Testing<end title> 4. <stylesheet:http://www.globalaircraft.org/default.css;> 5. 6. 7. <table width:95%;border:1;padding:5;> 8. <row> 9. <cell align:left;valign:top;width:50%;> 10. <!-- The AScript link below gives MSIE a different link than all 11. other browsers, because IE will render the 12. source as HTML instead of text --> 13. <align:center;> 14. <large>Contents of '<link:&showSource('<?AScript $br=browserInfo;if ($br contains("microsoft")i) {print "view-source\:";} ?>http://galire.globalaircraft.org/sandbox/sampleXML.txt');><color:green;>sampleXML.txt<end color><end link>':<end large><new><new> 15. <end align> 16. 17. <small> 18. <?AScript 19. 20. open("sampleXML.txt") as(#FH); 21. @XMLFile=#FH; 22. remove(1-8) from(@XMLFile); 23. @XMLFile=replace(/</)g with("<") in(@XMLFile); 24. @XMLFile=replace(/>/)g with(">") in(@XMLFile); 25. 26. print join(@XMLFile) by("<new>"); 27. 28. 29. ?> 30. <end small> 31. <end cell> 32. <cell align:left;valign:top;> 33. <!-- The AScript link below gives MSIE a different link than all 34. other browsers, because IE will render the 35. source as HTML instead of text --> 36. <align:center;> 37. <large>Contents of '<link:&showSource('<?AScript $br=browserInfo;if ($br contains("microsoft")i) {print "view-source\:";} ?>http://galire.globalaircraft.org/sandbox/usrData.txt');><color:green;>usrData.txt<end color><end link>':<end large><new><new> 38. <end align> 39. 40. <small> 41. <?AScript 42. 43. open("usrData.txt") as(#DF); 44. 45. 46. /* only select 1-# because the first line is a comment*/ 47. @dataFile = select(1-solve(length(#DF)-1)) from(#DF); 48. close(#DF); 49. 50. add("bettie:29") to(@dataFile); 51. 52. while ($line = @dataFile) { 53. ($usrname,$age) = split($line) by(":"); 54. 55. if ($age > 17) {print "$usrname is of age<new>";} 56. else {print "$usrname is under age<new>";} 57. 58. } 59. 60. ?> 61. <end small> 62. <end cell> 63. <end row> 64. <end table> 65. 66. <new><new> 67. 68. <align:center;><link:&showSource('http://galire.globalaircraft.org/sandbox/view-source.pl?file=fileEdit.gacp');underline:false;overline:true;><color:blue;bold:true;>View Source<end color><end link><end align> 69. 70. <new><new> 71. 72. <link:http://galire.globalaircraft.org/sandbox/index.gacp;class:reg1p5;><color:#000088;>Back to /sandbox/<end color><end link> 73. 74. <? 75. method showSource($URL) { 76. open($URL,"height:400;width:600;resizable:true;scrollbars:true;statusbar:true;") as(#SourceWindow); 77. } 78. ?> 79. 80. 81. </GALiRe>
Back to /sandbox/