Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrap text?? 2

Status
Not open for further replies.

arentango

Technical User
Jul 12, 2004
8
US
In Attachmate Extra X-Treme 8.0

I have a screen area that text wraps on and I'm trying to use a macro that sends text from a freeform textbox into the screen area (which will break the freeform text if a word is longer than the screen area it will wrap that text to the next line, breaking a word in 1/2)

Is it possible for a dialog box to have a text box that wraps text? I can only get it to have one continious line of text.

Please help, I can't figure this out!
 
I don't think that dialog boxes will allow multi-lines in EB. However, what's wrong with having a single line Dialog box where you capture the string, and then use SendKeys to send the data and let Extra make it wrap?

calculus
 
These fields are freeform text for documents that print from our system. If the text enetered in the textbox does not match the screen, then the words that continue to the next line are given a space between the two parts of the word (when printed from the system). I was hoping to have a way to limit the textbox to wrap at the same location that the Attachmate screen wraps, so that this "breaking" of words could be prevented.
 
If you want the text to work this way:
Hello. T
his is y
our mess
age.

You could take your variable that you're trying to input to the screen (VarInput) and break it up. Something like. This is assuming a width of 80.

HowLong = Len(VarInput)
For x = 0 to HowLong/80
ContinueAt = (x*80)+1
Put80 = Mid(VarInput,ContinueAt,80)
MySess.PutString Put80,x+RowToBeginInputAt,1
Next

So the first time through the loop it'd be 1-80, the second time would be 81-160, and so on.


If you want it to work this way:
Hello.
This is
your
message.

Then you'll want to use GetField. It'd be something like this.
x = 0
y = 0
z = 0
While x < Len(VarInput)
HowLong = 0
ThisBit = ""
While HowLong < 80
ThatBit = ThisBit
ThisBit = ThisBit + GetField(VarInput,y," ")+" "
y = y + 1
HowLong = Len(ThisBit)
Wend
y = y - 1
x = x + HowLong
MySess.PutString ThisBit,z+StartRow,1
z = z + 1
Wend

As for a dialog box, I remember reading something on the Attachmate site regarding a dialog box with word wrap. You might want to check there site to see if you can find anything about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top