Ciao, se ho ben compreso la tua richiesta, il problema potrebbe essere risolto come indicato nel listato seguente, anche se la soluzione forse non č molto elegante (sono anche io alle prime esperienze di VB6):
___________
Option Explicit
Dim base, check, esp, n, temp
Private Sub Command1_Click()
check = True
base = Val(txtBase): esp = Val(txtEsp)
n = 1
temp = 1
Do
Do While n <= (esp + 1)
n = n + 1
temp = temp * base
If n = esp + 1 Then
check = False
Exit Do
End If
Loop
Loop Until check = False
txtRisultato = temp
End Sub
Private Sub Form_Load()
base = Val(txtBase): esp = Val(txtEsp)
Label4 = base & " ^ " & esp & " = "
End Sub
Private Sub txtBase_Change()
Correggi
txtRisultato = ""
End Sub
Private Sub txtEsp_Change()
Correggi
txtRisultato = ""
End Sub
Public Sub Correggi()
Label4 = Val(txtBase) & " ^ " & Val(txtEsp) & " = "
End Sub
____________
Saluti.
Sal47
|