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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a chr() function for tab

Status
Not open for further replies.

MForrest

Programmer
Jun 9, 2003
85
GB
Hi all something simple realy just cant find the solution, I want to align my text within a memo field this is how its looking at the mo:

Page Type: Location
Field: Site Name
Changed From:
Changed To: TEST1
Changed By: IMCLINCOLN
Originator: admin
On: 11/04/03

I tried using spaces to align this text but obviously could not get away with it.

Any ideas
 
MForrest

CHR(9)


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mike thanks for that, its working when I display my text to an edit box but when I store the text to a memo field and display it in a report I am facing the same problem, unaligned text. Any ideas here

Cheers
 
Hi Mforest,

I assume you have an EditBox control for editing the memo.
If that is the case, then,

Edit1.KeyPress Event
********************
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 9
This.Value = LEFT(This.Value,This.SelStart) ;
+ CHR(9) + SUBSTR(This.Value,This.SelStart+1)
NODEFAULT
KEYBOARD '{RIGHTARROW}'
ENDIF

This will insert a TAB without jumping to next control. However, the default behaviour of TAB will be lost.

If you want the benefit of both, then, I suggest you can use F5 as your TAB insertion and instead of 9 in above, check for the value of -4 since F5 =-4

:)

____________________________________________
Ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
I allow the user to view this transaction data held within a memo field on a form with an edit box, which using the chr(9) function is formatted appropriately:

Page Type: Location
Field: Site Name
Changed From:
Changed To: TEST1
Changed By: IMCLINCOLN
Originator: admin
On: 11/04/03

code example, I am storing the transaction history to a variable:
memo_value = "Page Type: " + chr(9)+ page_frame + chr(13) + "Field: " + chr(9)+ field_name ETC, ETC

code example, I then store the data in memo_value to my memo field:
replace rec_header.history_trans with memo_value

code example, I then search for the required record and display the transaction history for that record to an edit box:
locate for rec_header.record_id == test.record_id
thisform.Edit1.controlsource = 'rec_header.history_trans'

I then allow the user to print/preview this data within a report, I dont know if it is a setting on the report which affects the data but the format changes:

Page Type: Location
Field: Site Name
Changed From:
Changed To: TEST1
Changed By: IMCLINCOLN
Originator: admin
On: 11/04/03
 
sorry Mike even the html code for this website is affecting the tabs used in my example of how my text is being correctly displayed
 
MForrest,

even the html code for this website is affecting the tabs

You can fix that by enclosing the relevant text in code and /code tags (in square brackets).

Pity we can't solve your original problem that easily.

Mike


Mike Lewis
Edinburgh, Scotland
 
Hi MForest,

In your report, you have to choose a non-proportional font and not a proportional font. That will solve your problem in report. :)



____________________________________________
Ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top