|
|
|
|
|
| | |
| |
Active Server Pages ASP a directory of ASP tutorials applications scripts components and articles for the novice to professional developer. CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
|
|
Subject: |
Re: How to calculate the value of a string formula |
|
From: |
Doug Walker |
|
Date: |
1/14/1999 1:24:28 PM |
|
IP: |
209.214.48.42 |
Caven wrote:
>In my asp file,(use vbscript language)There is a >text box, User input a string expression,such as >input (7 + 8 ) / 2 - 1 in the text box.
>you know it is a string you entered. it cant use >cdbl function,because it is a string.display:
><%=cdbl("(7+8)/2-1")%>, Its wrong.
>What do i do ?
Hmmmmmm....this is a challege in VBscript. I dont know of an equivalent function to Eval(). Maybe Chris Williams could jump in here.
If you dont mind a client side solution you could try using the onBlur event handler and the Eval() function in javascript. This way the equation is evaluated when the text box loses focus leaving a number you could then handle in VBscript.
Doug |
Previous Message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|