本帖最后由 低调点 于 2012-4-11 10:38 编辑
很多语言都有这个hello world.... 简单写了几个实现方法
控制台版本的 hello world
(不知道控制台是什么?那就先看这里->http://baike.baidu.com/view/3124124.htm )
import console;//打开控制台
console.log("hello world!")
execute("pause") //按任意键继续
;//关闭控制台
winform版本的 hello world
winform是什么?
WinForms应用程序一般都有一个或者多个窗体提供用户与应用程序交互。窗体可包含文本框、标签、按钮等控件。
import win.ui;
/*DSG{{*/
var winform = win.form( bottom=399;parent=...;text="aardio Form";right=599 )
winform.add(
button={ bottom=267;right=419;left=155;top=143;z=1;text="点击这里";cls="button" }
)
/*}}*/
winform.button.oncommand = function(id,event){
win.msgbox("hello world","这里是标题")
}
winform.show();
win.loopMessage();
webui版本的 hello world
webui是什么?
webui就是以html,css,javascript编写成的网页当作软件界面,aardio可以直接用html编写软件界面,并且直接在网页内用javascript调用aardio代码,也可以用htmlayout实现更炫的效果
import win.ui;
/*DSG{{*/
var winform = win.form( scroll=1;bottom=399;parent=...;text="aardio Form";right=599 )
winform.add( )
/*}}*/
import web.form;
//创建web窗体
var wb = web.form( winform
,//可输入_UIFLAG_ 前缀的常量自定义外观
,//可输入_DLCTL_ 前缀的常量以控制下载行为
,//"USER AGENT"
);
//打开目标网站
//wb.go("http://bbs.aardio.com/")
//或者直接写入html代码
var html = /*
<font size=30 color=red>hello world!</font><br>
<button>点击这里试试</button>
*/
wb.write(html)
//显示窗体
winform.show();
//进入消息循环
win.loopMessage();
return winform,wb;
右下角气泡 hello world
import win.ui;
/*DSG{{*/
var winform = win.form( bottom=399;parent=...;text="aardio Form";right=599 )
winform.add( )
/*}}*/
import win.util.tray;
tray = win.util.tray(winform) //创建托盘图标
tray.pop("hello world~" )
winform.show();
win.loopMessage();
保存一个名为hello world.txt的文件
只需要一行代码,按[F7]发布后,双击运行一下就会有效果
string.save("hello world.txt", "内容:hello world")
创建一个名为hello的文件夹,并且里面还有个world文件夹
只需要2行代码
import fsys; //导入fsys库
fsys.createDir("hello/world") //创建多层文件夹
让百度搜索框显示hello world(百度手机版)
import win.ui;
/*DSG{{*/
var winform = win.form( bottom=310;parent=...;right=475;text="aardio Form" )
winform.add(
edit={ bottom=240;right=448;left=26;multiline=1;top=20;z=1;edge=1;cls="edit" }
)
/*}}*/
import web.form;
var wb = web.form( winform.edit )
wb.go("http://m.baidu.com/")
wb.wait()
var ele = wb.getEle("word")
ele.value = "hello world"
winform.show();
win.loopMessage();
|