Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET(ting) CENTURY OFF
Message
From
17/01/2007 11:11:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
17/01/2007 10:53:10
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01182918
Message ID:
01186302
Views:
17
>Thanks Dragan.
>Is there a way to string two commands together as in _vfp.docmd("SET CENTURY OFF")+_vfp.docmd("SET DATE YMD")
>in the run expression of the report?

Since these are function calls, there's an old syntax rule which may work - namely, in code you can line up function calls (without returning anything) by simply lining them in the same line and separating by comma, but that's old syntax which works only in code, and only when the first call is prefixed with =
=_vfp.docmd("SET Century off"),_vfp.docmd("SET DATE YMD")
Since expressions are evaluated, and I couldn't really decide the type of the value returned by these two (value is .null.), this should work as a workaround:
TRANSFORM(_vfp.docmd("SET Century off")) + TRANSFORM(_vfp.docmd("SET DATE YMD"))
IOW, since we don't care about what they return, may as well convert them into strings and add them as such.

You may also try
_vfp.docmd("SET Century off") and _vfp.docmd("SET DATE YMD")
which may work (works after a ? in command window - don't have a report at hand to try), or you may try with an OR instead, need to make sure BOTH get executed, and not sure about that with logical shortcut evaluation.

Yet another way around this may be
iif(isnull(_vfp.docmd("SET Century off")), _vfp.docmd("SET DATE YMD"), null)
once we're sure it always returns a null.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform