Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: How do I stop a dialog editbox from giving an error when all numbers are removed

7 views
Skip to first unread message

Stagsden

unread,
Aug 6, 2008, 9:40:12 AM8/6/08
to
Sorry, hit post button by accident.
this is the rest of the script.

Sub EditBox6_EventChange()

Dim This : Set This = EditBox6

            R10 = this.text

End Sub

 

Sub EditBox6_EventInitialize()

Dim This : Set This = EditBox6

            this.Text = R10

End Sub
Thanks
Stagsden

Stagsden

unread,
Aug 6, 2008, 9:40:12 AM8/6/08
to
When using an editbox in a SUD the box initialises with a variable. Then I would like to change the value in the editbox which works ok unless the editbox is cleared completely, then an error occurs because the R variable cannot be prescribed as zero.
 
I think that it is just a case of refreshing the contents when I leave the SUD. I press a button.
 
The text looks like this for the editbox.
 
Sub Editbox6_EventInitialise()
Dim This : Set This = Explanation
this.text  

Walter Rick

unread,
Aug 7, 2008, 2:40:10 AM8/7/08
to
Hi Stagsden, This is a VBS problem in general. The Type of Rx variables are explicit Double and the Edit.Text is a variant with the sub type string. If you assign something like R1 = edit.Text VBScript tries to convert a string into a double type. That works if the string is a regular numeric string like 12 or 3.13 - but it fails in case of a empty string (""). You can check that in the DIAdem SCRIPT editor like:Dim tt = "12"R1 = tmsgbox R1and t = ""
R1 = t
msgbox R1
We have an example  which shows how to handle such stuff and it shows how you can check the entry. Please have a look at "Checking Dialog Box Entries"GreetingsWalter
0 new messages