I'm struggling a bit to try to get some code to update a userlabel. Seems there are a few ways of doing this. So far I've found:
Method 1
Qty = GetUserLabel(61)
Qty = Question("Enter Quantity of Line " & ThisPriority)
SetUserLabel(61,Qty)
But there is no way to pick up the current value of the label to use as a default - means the user has to type new every time
Method 2
Begin Dialog TextBoxSample 16,30,180,96,"Enter Required Quantity"
OKButton 132,20,40,14
CancelButton 132,44,40,14
Text 8,8,32,8,"Text Box:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample
Button = Dialog ( Dlg1 )
SetUserLabel ( 61,Dlg1.TextBox1 )
Same problem - I can't figure a way to show the current value, and the user has to click into the field before entering data
Method 3
Default = GetUserlabel(61)
Answer = InputBox$("Enter data", "Title", Default, 200, 200)
SetUserLabel(61,Answer)
Now this one I like - but i can't crack the last bit - how to not update anything when cancel is pressed ! At the moment the contents of the label are wiped if cancel is pressed, and I'd liek them to be left alone !
The Cypress Enable manual is full of detail about how to construct dialogs, but there is a level of assumed knowledge about what to do with the output that I simply don't have !
Tim