Variable in Dialog

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
HolyAbsolut
Newbie
Posts: 17
Joined: Wed Sep 21, 2011 10:28 am

Variable in Dialog

Post by HolyAbsolut » Tue Jan 17, 2012 4:54 pm

Hello @ all,

I have problem and I didn´t find the solution in the Forum (only for the old Dialog handler)

I want display a variable in a Dialog. But it doesn´t work.

FYI: Im Using MacroSchedular 12.1.10 and Windows XP


Below an example:

Dialog>Dialog1
object Dialog1: TForm
Left = 251
Top = 104
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 94
ClientWidth = 278
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 Label1: TLabel
Left = 120
Top = 32
Width = 38
Height = 13
Caption = '%VAR%'
end
end
EndDialog>Dialog1


Let>%VAR%=Works!

Show>Dialog1
Wait>5





Thanks for your support.

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jan 17, 2012 5:10 pm

You can't place variables into a dialog block. Instead use the SetDialogProperty> function.

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 365
  Top = 169
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'CustomDialog'
  ClientHeight = 94
  ClientWidth = 278
  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 Label1: TLabel
    Left = 120
    Top = 32
    Width = 3
    Height = 13
  end
end
EndDialog>Dialog1

SetDialogProperty>Dialog1,Label1,Caption,Works!

Show>Dialog1
Wait>5

HolyAbsolut
Newbie
Posts: 17
Joined: Wed Sep 21, 2011 10:28 am

Post by HolyAbsolut » Tue Jan 17, 2012 5:20 pm

Hi,

Thanks a lot!Have a nice evening.

Best regards

HolyAbsolut

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