Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFp 6 Using a case statement in a report field
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00339722
Message ID:
00339887
Views:
32
>>I created a .prg called "secorder.prg" with this code:
>>do case
>>case section = "A"
>>store "Mares Foaled" to msection
>>case section = "B"
>>store "Mares Bred" to msection
>>case section = "C"
>>store "Vet. Report" to msection
>>case section = "D"
>>store "Absentees" to msection
>>otherwise
>>store " " to msection
>>endcase
>>
>>Then I added a variable to my report form called "msection" and made the 'value to store' = secorder()
>>
>>After testing it appears that I need to add two fields to my report form, one for msection, and one for secorder().
>>
>>If I don't, instead of seeing "Mares Foaled", "Mares Bred", etc., etc., I get .t. as the value on the report.
>>
>>Do I need to keep both fields on the report? I could move the field containing secorder() in the expression to the side, as it's the one showing ".t." as its result, and make it narrow so the .t. doesn't appear to noticeable, but that's not really the best solution.
>>
>>Am I still missing something?
>>
>>Thanks,
>>
>>Jim
>
>Have your UDF return the value to display in the field. This eliminates the need to do anything about the .T. or trying to display a variable.


Fred,

Please bear with me, but I guess I don't know how to do this. Could you explain further on how I get the result of the secorder.prg to display in the field.

Thanks for the help.

Jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform