Beispiel #1
0
func (this *AccountInfo) execute(isSync bool) {
	for {
		fmt.Println("\n\n", this.GetTitlePath(this.languageIndex), "\r\n")
		this.PrintSubmenu()
		fmt.Printf("\n %s", this.GetInputMemo(this.languageIndex))

		var input string

		_, err := fmt.Scanf("%s\n", &input)
		if err == nil {
			selectIndex, b := publicdefine.IsNumber(input)
			if b {
				if selectIndex <= len(this.subItems) && selectIndex >= 0 {
					this.subItems[selectIndex-1].ExecuteFunc(false)
					ret := this.subItems[selectIndex-1].ExecFlag()
					if ret == BACK_TO_MENU_FLAG {
						break
					}
				}
			}
		} else {
			fmt.Println(err)
		}
	}
	if !isSync {
		this.ASyncChan <- 1
	}
}
Beispiel #2
0
func (this *MenuInfo) Execute(isSync bool) {
	for {
		fmt.Println("\r\n******************************************************")
		fmt.Println(this.getWelcomeString(this.languageIndex))
		fmt.Println(" " + this.GetTitle(this.languageIndex))
		this.PrintSubmenu()
		fmt.Printf("\n %s", this.GetInputMemo(this.languageIndex))

		var input string

		_, err := fmt.Scanf("%s\n", &input)
		if err == nil {
			selectIndex, b := publicdefine.IsNumber(input)
			if b {
				if selectIndex <= len(this.subItems) && selectIndex > 0 {
					this.subItems[selectIndex-1].ExecuteFunc(false)
					this.subItems[selectIndex-1].ExecFlag()
				}
			}
		}
	}
}