WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Display Data in Columns


Question:

In this snippet of code as an example, how can I make sure that all the trailing x are align as a column? I can't find the way to do this, I'm sure it's easy.
liste1 = "1,2,3"
liste2 = "1,2,3,4,5"
liste3 = "1,2,3,4,5,6,7,8,9"

liste = ""

for xx = 1 to 3
liste%xx% = StrFix(liste%xx%, " ", 30)
liste%xx% = StrCat(liste%xx%, "x")
next

liste = StrCat(liste1, @cr, liste2, @cr, liste3)
Message("", liste) 

Answer:

Ummm. Not easy at all. Might as well consider it impossible. The trouble is that MessageBox's use a proportional (varying-width) font.

The best you can do is make a simple dialog using a fixed pitch font (Courier) for the font in the display box.

liste1 = "1,2,3"
liste2 = "1,2,3,4,5"
liste3 = "1,2,3,4,5,6,7,8,9"

liste = ""

for xx = 1 to 3
liste%xx% = StrFix(liste%xx%, " ", 30)
liste%xx% = StrCat(liste%xx%, "x")
next

liste = StrCat(liste1, @crlf, liste2, @crlf, liste3)
MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=`WIL Dialog 1`
MyDialogX=002
MyDialogY=050
MyDialogWidth=408
MyDialogHeight=260
MyDialogNumControls=003
MyDialogProcedure=`DEFAULT`
MyDialogFont=`Courier|5325|40|49`
MyDialogTextColor=`0|0|0`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`113,242,033,011,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`262,242,033,011,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`068,036,187,080,VARYTEXT,liste,"",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")

Or use some other message like...

liste1 = "1,2,3"
liste2 = "1,2,3,4,5"
liste3 = "1,2,3,4,5,6,7,8,9"

liste = ""

For xx = 1 To 3
liste%xx% = StrFix(liste%xx%, " ", 30)
liste%xx% = StrCat(liste%xx%, "x")
Next

liste = StrCat(liste1, @CR, liste2, @CR, liste3)
IntControl(28,1,0,0,0)
AskItemlist("Title",liste,@CR,@UNSORTED,@SINGLE) 

Article ID:   W16420
File Created: 2005:02:18:12:20:28
Last Updated: 2005:02:18:12:20:28