Click here to Skip to main content
15,916,835 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralVB Slowdown after compilation Pin
Anonymous27-Aug-03 15:05
Anonymous27-Aug-03 15:05 
GeneralRe: VB Slowdown after compilation Pin
Ray Cassick27-Aug-03 15:23
Ray Cassick27-Aug-03 15:23 
GeneralRe: VB Slowdown after compilation Pin
Dave Kreskowiak28-Aug-03 9:01
mveDave Kreskowiak28-Aug-03 9:01 
Generalone stupid question.. Pin
pnpfriend27-Aug-03 9:45
pnpfriend27-Aug-03 9:45 
Generalforget it.. got it Pin
pnpfriend27-Aug-03 10:25
pnpfriend27-Aug-03 10:25 
General.NET Web Service with VB6 and Soap Toolkit 3 Pin
cory_baker27-Aug-03 4:38
cory_baker27-Aug-03 4:38 
Generalbundling VB.net runtime Pin
Jcg3127-Aug-03 4:21
Jcg3127-Aug-03 4:21 
GeneralLoop thru in string Pin
Member 53357326-Aug-03 22:42
Member 53357326-Aug-03 22:42 
GeneralAutomation server problem Pin
clone_21226-Aug-03 21:21
clone_21226-Aug-03 21:21 
Generalafter change the display resolution with VB6 Pin
ChinhChua26-Aug-03 18:25
ChinhChua26-Aug-03 18:25 
QuestionHow to add Macromedia Flash to My VB.Net Form?? Pin
MJay26-Aug-03 16:49
MJay26-Aug-03 16:49 
Questionhow to control msword in my program? Pin
fftongzhi26-Aug-03 15:49
fftongzhi26-Aug-03 15:49 
QuestionHow to associate a cursor with my App Pin
elmahdy26-Aug-03 15:26
elmahdy26-Aug-03 15:26 
AnswerRe: How to associate a cursor with my App Pin
Hesham Amin27-Aug-03 22:00
Hesham Amin27-Aug-03 22:00 
GeneralRe: How to associate a cursor with my App Pin
Anonymous28-Aug-03 2:28
Anonymous28-Aug-03 2:28 
GeneralRe: How to associate a cursor with my App Pin
Hesham Amin28-Aug-03 4:12
Hesham Amin28-Aug-03 4:12 
Generalneed good books for GUI design Pin
Anonymous26-Aug-03 14:54
Anonymous26-Aug-03 14:54 
GeneralRe: need good books for GUI design Pin
Ray Cassick26-Aug-03 16:42
Ray Cassick26-Aug-03 16:42 
GeneralRe: need good books for GUI design Pin
J. Dunlap26-Aug-03 16:56
J. Dunlap26-Aug-03 16:56 
Generaltrouble with msbind.dll Pin
Marcel Härry26-Aug-03 14:12
Marcel Härry26-Aug-03 14:12 
GeneralTranslation needed Pin
oliver_twistor26-Aug-03 11:24
oliver_twistor26-Aug-03 11:24 
GeneralRe: Translation needed Pin
Ian Darling27-Aug-03 0:01
Ian Darling27-Aug-03 0:01 
GeneralRe: Translation needed Pin
oliver_twistor27-Aug-03 4:03
oliver_twistor27-Aug-03 4:03 
GeneralRe: Translation needed Pin
Ian Darling27-Aug-03 4:27
Ian Darling27-Aug-03 4:27 
GeneralRe: Translation needed Pin
oliver_twistor27-Aug-03 22:31
oliver_twistor27-Aug-03 22:31 
Thanks, but I have already worked it out. It was only one small adjustment I had to do in my code to make it worked.

I did it like this:

<br />
Dim x As Integer<br />
    Dim y As Integer<br />
    Dim counter As Integer<br />
    Dim check As Boolean<br />
<br />
<br />
    Private Sub Bttn_Fkltt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bttn_Fkltt.Click<br />
        x = TxtBx_Fkltt.Text<br />
        counter = 1<br />
        check = False<br />
        y = x * (x - 1)<br />
        If x > 2 Then<br />
            Do Until check = True<br />
                counter = counter + 1<br />
                y = y * (x - counter)<br />
                If counter = x - 1 Then<br />
                    check = True<br />
                    Exit Do<br />
                End If<br />
            Loop<br />
            Lbl_Fkltt.Text = y<br />
        Else<br />
            Lbl_Fkltt.Text = y<br />
        End If<br />
    End Sub<br />


Look at the code: If counter = x - 1 Then. Before, I had If counter = x Then, and with that code, y was multiplied with 0 in the end, resulting in y = 0.

//OT

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.