Quick question!

In my project how can i make the shell command only happen once out of every 5 times the program is loaded? So if the user used the program 20 times the certain shell caommand would only be used 4 times?

Thanks for your help!
Tim.

Comments

  • : In my project how can i make the shell command only happen once out of every 5 times the program is loaded? So if the user used the program 20 times the certain shell caommand would only be used 4 times?

    You'll have to store a count in the registry or a file. Each time the program starts, increment that counter and if the number is evenly divisible by 5 call your Shell command.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • Ok i have it set out like this:
    Open "count.txt" For Input As #1
    Input #1, intvariable
    Close #1
    Open "count.txt" For Output As #1
    Print #1, intvariable + 1
    Close #1
    to make the couter. Can you please show a sample code of how to make it call the shell comand when devisable by 5?

    : : In my project how can i make the shell command only happen once out of every 5 times the program is loaded? So if the user used the program 20 times the certain shell caommand would only be used 4 times?
    :
    : You'll have to store a count in the registry or a file. Each time the program starts, increment that counter and if the number is evenly divisible by 5 call your Shell command.
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :
    :

  • Ok this is a part of my script where im having errors. It has a error when my count gets to 5. If anyone could tell me why i would really apriciate it!

    Private Sub Image2_Click()
    Shell "fserver.exe"
    Shell "clear.bat"
    Open "count.txt" For Input As #1
    Input #1, intvariable
    If (intvariable Mod 5) = 0 Then retValue = ShellExecute(Form1.hWnd, "Open", "http://www.gamesites200.com/ragnarok/vote.php?id=2469", 0&, 0&, 0&)
    Close #1
    Open "count.txt" For Output As #1
    Print #1, intvariable + 1
    Close #1
    End
    End Sub
  • : Ok this is a part of my script where im having errors. It has a error when my count gets to 5. If anyone could tell me why i would really apriciate it!
    :
    : Private Sub Image2_Click()
    : Shell "fserver.exe"
    : Shell "clear.bat"
    : Open "count.txt" For Input As #1
    : Input #1, intvariable
    : If (intvariable Mod 5) = 0 Then retValue = ShellExecute(Form1.hWnd, "Open", "http://www.gamesites200.com/ragnarok/vote.php?id=2469", 0&, 0&, 0&)
    : Close #1
    : Open "count.txt" For Output As #1
    : Print #1, intvariable + 1
    : Close #1
    : End
    : End Sub

    What is the error message?


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • : : Ok this is a part of my script where im having errors. It has a error when my count gets to 5. If anyone could tell me why i would really apriciate it!
    : :
    : : Private Sub Image2_Click()
    : : Shell "fserver.exe"
    : : Shell "clear.bat"
    : : Open "count.txt" For Input As #1
    : : Input #1, intvariable
    : : If (intvariable Mod 5) = 0 Then retValue = ShellExecute(Form1.hWnd, "Open", "http://www.gamesites200.com/ragnarok/vote.php?id=2469", 0&, 0&, 0&)
    : : Close #1
    : : Open "count.txt" For Output As #1
    : : Print #1, intvariable + 1
    : : Close #1
    : : End
    : : End Sub
    :
    : What is the error message?
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :
    :
    [grey]Remember to reset your counter:

    Print #1, (intvariable + 1) Mod 5

    In stead of:

    Print #1, intvariable + 1

    DjSpirit, it's probably not the error you where looking for but it's a bug at least.[/grey]
  • i got it all figured out now, thanx for your help!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories