看板 Visual_Basic 關於我們 聯絡資訊
※ 引述《fumizuki (小獅子)》之銘言: : '指數運算 : o = "^": GoSub SearchProc 指數前面應該不會有人打+-*/號吧??? : If p > 0 Then : GoSub SplitProc : If op1 Like "-*" Then : Eval = -Eval(Mid(op1, 2)) ^ Eval(op2) : Else : Eval = Eval(op1) ^ Eval(op2) : End If : GoTo EndProc : End If : Eval = Val(s) : EndProc: : c = c - 1: Exit Function : SearchProc: : p = Len(s) + 1 : Do : p = InStrRev(s, o, p - 1) : If p <= 1 Then : f = 0 '首字忽略;找不到則離開迴圈 : Else : a = Mid(s, p - 1, 1) : If a = "+" Or a = "-" Or a = "*" Or a = "/" Or a = "^" Then : f = 1 : Else : f = 0 : End If : End If : Loop While f = 1 : If p = 1 Then p = 0 : Return : a = Mid(s, p - 1, 1) : If a = "+" Or a = "-" Or a = "*" Or a = "/" Or a = "^" Then : f = 1 : Else : f = 0 : End If : End If : Loop While f = 1 : If p = 1 Then p = 0 : Return -- 少年讀書,如隙中窺月; 中年讀書,如庭中望月; 老年讀書,如臺上玩月。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.141.158.129
fumizuki:的確是不會 210.58.156.43 06/12
fumizuki:修掉了... 210.58.156.43 06/12
TrueFeeling:修在哪裡220.141.158.129 06/12
fumizuki:在SearchProc裏 多一行 210.58.156.43 06/12
TrueFeeling:如果把: GoSub SearchProc刪掉是不是也可以220.141.158.129 06/12
fumizuki:不行 210.58.156.43 06/12
TrueFeeling:對吼,還有p220.141.158.129 06/12