Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime
Does anyone know the difference in runtime and memory usage for
IF..Then..Else and a Switch statement in VBA, when the two are equivalent expressions? Thank you. Brent |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime
This is a synopsis, but not necessarily complete.
Runtime is while the code is executing. Memory usage is the storage required to compile and execute a procedure. ' If..Then..Else sets a condition which if met, or not met will result in some response, or lack of response as determined by the user, with the Else occuring when the first condition does not apply.' The Switch function provides a facility to use different definitions for the same variable and match the definitions modifier for each switch.' I don't know that you could say any two are equivalent, but you could conceivably get a similar result using Switch in place of an If...Then. For more information, refer to the VBA help files. "Brent" wrote: Does anyone know the difference in runtime and memory usage for IF..Then..Else and a Switch statement in VBA, when the two are equivalent expressions? Thank you. Brent |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime
P.S. If you meant the difference in time and/or the
difference in amount. I don't know. "Brent" wrote: Does anyone know the difference in runtime and memory usage for IF..Then..Else and a Switch statement in VBA, when the two are equivalent expressions? Thank you. Brent |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime
All of the expressions in a Switch or IIF statement are evaluated whether or not they are true. An If/Then or Select case statement stops evaluation with the first condition that is True. Draw your own conclusion. I tend to favor the Select Case statement for more than 3 conditions. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Brent" wrote in message Does anyone know the difference in runtime and memory usage for IF..Then..Else and a Switch statement in VBA, when the two are equivalent expressions? Thank you. Brent |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime | Excel Discussion (Misc queries) | |||
Runtime error | Excel Discussion (Misc queries) | |||
Runtime 429 | Excel Programming | |||
Runtime error 91 help | Excel Programming | |||
Runtime Error | Excel Programming |