Sign in to follow this  
Followers 0
eddyd

Aligning text captured

4 posts in this topic

#1 ·  Posted (edited)

What i try to do is following

1.capture text from the active window.

2.This text is in columns. So I created variables for each column $col1 , $col2

3.Rearrange the text blocks in a new order . I created a variable $newview = $col3 & @tab & $col2...

4.copy this info to the clipboard so it can be pasted in an email.

This works, however when you paste it, the view looks garbled

exampledata1 result1

exampledatammm result2

exampledata123 result2

....

I've used $col1 = StringFormat("%-31.31s", $col1) to control the string width for each column

So I assumed the output would form neat columns. The problem seems to be caused by the fonttype.

Although each string from col1 is exactly 31 characters long, the field lenght is not equal if more 'wide' characters are in the string

This causes the tab instruction to jump to the next tab.

Is there a way to control this ?

Edited by eddyd

Share this post


Link to post
Share on other sites



The easiest way to avoid this effect is to use a fixed-space font like "Courier New", where an "i" is as wide as a "w".

You could also try to put your data into a html table instead of plain text, some mail programs can interpret html in the mail code and display a table.

Best regards,

Marc


It's my job to comfort the disturbed and to disturb the comfortable.

Share this post


Link to post
Share on other sites

The easiest way to avoid this effect is to use a fixed-space font like "Courier New", where an "i" is as wide as a "w".

You could also try to put your data into a html table instead of plain text, some mail programs can interpret html in the mail code and display a table.

Best regards,

Marc

I also thought of that, but how do I do that ? How do I define that $newview should use courier font ?

rgds/eddy

Share this post


Link to post
Share on other sites

eddyd,

The clipboard data takes on the default font of your e-mail program when it is "pasted in an email". So it is in your e-mail program that you need to set the mono-spaced font.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0