Re: Problem with TextBox from dfanning.com [message #40460] |
Wed, 11 August 2004 06:09  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Lloyd Watkin writes:
> I'm using David Fanning's widget from his website. I have come across
> a problem however. Here is my calling sequence:
>
> IFCANCELLED: ; Label if box is cancelled
> inputvalue = TextBox(Title="Please enter value:", Label=inputname,
> Cancel=cancelled, value=string(inputvalue2))
> IF (cancelled OR (inputvalue EQ "")) THEN begin
> warning = DIALOG_MESSAGE("A value must be
> entered",TITLE="Warning!")
> stop
> GOTO, IFCANCELLED
> endif
>
> The problem is that if I enter a null string or click the cancel
> button I get the following error message back out:
>
> "WIDGET_LABEL: String expression required in this contact: LABEL."
>
> I don't understand this at all! Any help on this much appreciated.
It means that whatever you have in the variable "inputname"
isn't a string. Try putting a "HELP, inputname" just before
the call the TEXTBOX to see what it is.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Problem with TextBox from dfanning.com [message #40529 is a reply to message #40460] |
Fri, 13 August 2004 06:57  |
lloyd
Messages: 16 Registered: February 2003
|
Junior Member |
|
|
[...]
>> I don't understand this at all! Any help on this much appreciated.
>
> It means that whatever you have in the variable "inputname"
> isn't a string. Try putting a "HELP, inputname" just before
> the call the TEXTBOX to see what it is.
For some reason I was initially entering a string but it was returning
inputname as a float (?!?!). I got around this by copying the input
string into a temporary variable and copying it back to the original
variable if the textbox needed to be reopened.
Thanks
Lloyd
|
|
|
Re: Problem with TextBox from dfanning.com [message #40530 is a reply to message #40460] |
Fri, 13 August 2004 06:57  |
lloyd
Messages: 16 Registered: February 2003
|
Junior Member |
|
|
[...]
>> I don't understand this at all! Any help on this much appreciated.
>
> It means that whatever you have in the variable "inputname"
> isn't a string. Try putting a "HELP, inputname" just before
> the call the TEXTBOX to see what it is.
For some reason I was initially entering a string but it was returning
inputname as a float (?!?!). I got around this by copying the input
string into a temporary variable and copying it back to the original
variable if the textbox needed to be reopened.
Thanks
Lloyd
|
|
|