informix-4GL
menu 菜單選項
Menu語法
main
call main_menu() --呼叫菜單語法
clear screen
end main
function main_menu()
define menu_name char(10), --宣告meun_name菜單標題變數
response char(1),
menu menu_name --指定meun_name變數為菜單標題
before menu
prompt "你要先看簡短菜單還是完整菜單?(s/l)"
for char response
if response = "[Ss]" then --若輸入s(大小寫)
let menu_name = "SHORT_MENU" --標題名稱為短菜單
hide option all --隱藏全部的選項
show option "Customer", "Orders", "Exit" --顯示這三個選項
if response = "[Ll]" then
let menu_name "LONG_MENU" --標題名稱為長菜單
else
ERROR "長或短,輸入S或L,懂?" ATTRIBUTE (RED,UNDERLINE)
end if
end if
command "客戶資料" "Go to the CUSTOMER menu" --command指令指定菜單選項
call a()
command "訂單資料" " Go to the ORDER menu "
call b()
command "產品資料" "Go to the PRODUCTS menu"
call c()
command "業務資料" "Go to the SALES menu."
call d()
command "Exit" "Return to the operating system."
exit menu
end menu
end function
function a()
end function
function b()
end function
function c()
end function
function d()
end function
留言列表