Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form exits VFP 7 when clicked on
Message
From
16/04/2004 11:15:45
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00894140
Message ID:
00895556
Views:
21

Fabio,

The assert command simply does nothing in the runtime, so there's no need to have the code removed.
...


David, for does nothing, VFP it cannot demand of the time.

BUT THIS IS NOT TRUE, at runtime VFP evaluate ASSERT token, it not eval the expression

ASSERT is fast, but it consumes a little time.

Put next code into a project, run this at design,
compile into a exe, close VFP and run.
MESSAGEBOX("startMode   "+TRANSFORM(_VFP.StartMode))
FOR I=1 TO 10000000
NEXT

t1=SECONDS()
FOR I=1 TO 10000000
NEXT
looptime=SECONDS()-M.T1

t1=SECONDS()
FOR I=1 TO 10000000
*!*	  ASSERT .T. MESSAGE "ASSERT MESSAGE"
*!*	  ASSERT .T. MESSAGE "ASSERT MESSAGE"
*!*	  ASSERT .T. MESSAGE "ASSERT MESSAGE"
NEXT
without=SECONDS()-M.T1-m.looptime

t1=SECONDS()
FOR I=1 TO 10000000
  ASSERT .T. MESSAGE "ASSERT MESSAGE"
  ASSERT .T. MESSAGE "ASSERT MESSAGE"
  ASSERT .T. MESSAGE "ASSERT MESSAGE"
NEXT
withassert=SECONDS()-M.T1-m.looptime

MESSAGEBOX("WITHOUT assert "+TRANSFORM(m.without)+CHR(13);
		+  "WITH    assert "+TRANSFORM(m.withassert))
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform