Simplicty and flexibility!


New Function in 8 - SetLabelText() - Set a label directly from programming (Ver 8.0.0.1281)

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

New Function in 8 - SetLabelText() - Set a label directly from programming (Ver 8.0.0.1281)

SetLabelText() is a function that will allow you to change a label from anywhere in DataEase 8. You can use it from ExecDQL, in a field derivation or from a button. 

Like all new Set functions it works on the Form context so you will use the object denomination "objectname".

SetLabelText("MyLabel","This is a sample") 
SetLabelText("MyLabel",Field1)
SetLabelText("MyLabel",concat(GetGlobal("LabelVar"),";",MyField))

NB! All object names are case-sensitive!

Label as a "virtual" field.

You can use Labels as Messages and you can combine them with SetState() for hiding and showing, SetColor() to change the color and background color etc. 

One of the obvious benefits over normal fields is that they are not fields. Fields are part of the data-schema and if you change a field it will affect the status of the form as being "changed", this does not happen when you use a label.

Another great benefit is that they are transparent, so you can put them on top of Images etc.

NB! Remember that the size of a label cannot be changed from this function so make sure that your label object is large enough to accommodate your message. A label will typically be the right size for it's original content so you will have to drag it out to the max size of the content you want to fit. Labels are automatically multiline.

Written by DataEase 06/05/13 at 10:38:26 Dataease [{8}]FIVE
DG3_BlogList