Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine tabs needed for caption formating?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00903326
Message ID:
00903371
Views:
18
Hi Barbara,

Thanks for the reply.

I had updated my own message, I guess you replied before my update. Yes, I am using space instead now. Your Max length solution is far better than my approach which uses the field size of label_name as max length. My approach works, but it creates a big gap between the labels and values when actual value is far less than field size, which is more often than not.

Really appreaciate it.

Dawa


>I'd suggest using spaces instead of tabs. If you use tabs, you have to take into account the spacing that the tab is using, and that can vary.
>
>To use spaces instead do this:
>
>* Get the longest label and add 1
>SELECT max(len(label_name))+1 ;
>   FROM mydb!table1 ;
>   INTO ARRAY laMaxCaption
>
>Then, when you format the return string, change the line to this:
>
>m.lcReturn = m.lcReturn + ;
>      ALLTRIM(m.laCaptions(i,1)) + ;
>      REPLICATE(' ',laMaxCaption[1]-len(laCaptions[i,1])+[: ]+ ;
>      TRANSFORM(EVALUATE(m.laCaptions(i,2)))+CHR
>
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform