Simplicty and flexibility!


Function::Internal

SetLabelText
SetLabelText("ObjectName","NewText")
SetLabelText("MyLabel","This is a test!")
SetLabelText("CustomerLabel","Please Enter correct customer Name!")
retval :=SetLabelText("MyButton","Click!") .


To change the text property on a Label, Button, Tab. This can be used for error message, further information, to store information in the page/form for future query, to change the label on a button or tab etc.

Parameters


ObjectName: Text

The name of the object that you want to change the text property off. All objects names are case sensitve.

NewText: Text

The new text you want to set on the object. Be aware that SetLabelText do not resize the object so make sure there is enough space for the new text on the object.

Returns/Result


Nothing

Examples


Reference

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.

See Also


On the forum about SetLabelText

On the blog about SetLabelText

DataEase 8 - Small Sample to show off SetState(),SetFocus(),SetColor(),SetLabelText() (Ver. 8.0.0.1281)

This is just a small sample to show off SetState() -  Hiding/showing/disabling/enabling of fields/buttons and other GUI objects, SetFocus() - set focus on any field or button etc that you want to have the...

Product: Dataease [{8}]FIVE. Written by DataEase 27/04/13 at 09:17:21

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 t...

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


dg3_HelpView