How to display input prompts in a list setting

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
rusty9073
Newbie
Posts: 4
Joined: Sat Dec 26, 2015 4:38 am

How to display input prompts in a list setting

Post by rusty9073 » Sat Jul 09, 2016 3:44 pm

Hi,

I have what should be an easy question that I don't know the answer to.
I would like my input prompts to display in a list fashion.

For example:
input>variable, 1. Dogs 2. Cats 3. Horses 4. Cows

will bring an input box of:
1. Dogs 2. Cats 3. Horses 4. Cows


I want the input prompt box to show as a list, like so:
1. Dogs
2. Cats
3. Horses
4. Cows.

If I add enough spacing between the descriptions items it will show in list form, but the spacing parameters are inconsistent and time consuming. I know there has to be a easy way to do this. Please let me know if you have the answer. Your assistance is greatly appreciated.

Thanks,
Nate

hagchr
Macro Veteran
Posts: 277
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: How to display input prompts in a list setting

Post by hagchr » Sat Jul 09, 2016 4:27 pm

Hi, you can eg use %CRLF% to get/create a new line, see example (I also added a (very) simple dialog example).

Code: Select all

//Normal input
Let>mess=1. Dogs%CRLF%2. Cats%CRLF%3. Horses%CRLF%4. Cows

Let>INPUT_BROWSE=0
Input>strRes,mess,




//With dialogs you can create your own things...
Dialog>Dialog1
object Dialog1: TForm
  Left = 247
  Top = 97
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'CustomDialog'
  ClientHeight = 102
  ClientWidth = 189
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object MSListBox1: tMSListBox
    Left = 4
    Top = 2
    Width = 181
    Height = 95
    ItemHeight = 13
    TabOrder = 0
    SelectedIndex = -1
  end
end
EndDialog>Dialog1

SetDialogProperty>Dialog1,mslistbox1,Text,mess
//Set up dialog
CODEBLOCK
    GetScreenRes>xRes,yRes
    SetDialogProperty>Dialog1,,Top,{%yRes%/2}
    SetDialogProperty>Dialog1,,Left,{%xRes%/2}
    SetDialogProperty>Dialog1,,Caption,Select Input
ENDCODEBLOCK

AddDialogHandler>Dialog1,mslistbox1,onClick,GetRes

Show>Dialog1,

SRT>GetRes
    GetDialogProperty>Dialog1,mslistbox1,SelectedItems,res
    CloseDialog>Dialog1
    MDL>You selected: %res%
END>GetRes

rusty9073
Newbie
Posts: 4
Joined: Sat Dec 26, 2015 4:38 am

Re: How to display input prompts in a list setting

Post by rusty9073 » Sun Jul 10, 2016 2:51 pm

Perfect! Thank you HAGCHR :)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts