-
I'm still trying to pause my ptogram for a tenth of a second.
it was recomended to me to use this line
Declare Sub pause Lib "kerne132" (ByVal dwMilliseconds As Long)
And then call it with
call pause(*time in milliseconds*)
the problem is where ever I put the Declare Sub... in the program it balks. If i put it at the top with my globals, it says it's not allowed in the Public members of the object modual. any where else, it says "Comments only may apear after end sub..." Even it I have it within a proceduer.
Please repspond quickly.
Thanks
-
You need to declare it in a module.
-
This may be a stupib Question, but what is a modual?
-
Ok, forget the modual question, but now my program is croaking on the "kerne123" part
-
Shouldn't that be Kernel32. With a L for lion, not a 1 as in one.
-
Try this declaration if you are declaring it in a form:
Code:
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
However if you want to use this function in a bunch of different forms, then click on Project/ Add Module on the menu and then in the General Declarations part of the Module drop the declaration like this:
Code:
Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
However the default state of sub/function declaration is Public so it is optional if you want to use the Public keyword.