if or and question

T

Thomas Henz

hi there again,

can someone please show me how to transfer this php line into asp?

if(($frm_quant=="") || !($frm_quant>0 && $frm_quant<=100))

thanks a lot,

tom
 
P

Paal Andersen

Thomas Henz said:
hi there again,

can someone please show me how to transfer this php line into asp?

if(($frm_quant=="") || !($frm_quant>0 && $frm_quant<=100))

thanks a lot,

tom

remove $
||= or
&& = and

so

if(frm_quant="" or not(frm_quant>0 and frm_quant<101)) then

end if

maybe there wil be a casting here like
len(cstr(frm_quant))=0


Paal
 
T

Tim Slattery

Thomas Henz said:
hi there again,

can someone please show me how to transfer this php line into asp?

if(($frm_quant=="") || !($frm_quant>0 && $frm_quant<=100))

Which language? In JavaScript, you'd have exactly the same syntax, but
the variable names would not have the $ prefix. In VBScript, the "=="
comparison operator is a single equal sign ("="). VBScript uses words
instead of symbols for logical operators (And, Or, Not). And you don't
need to surround the logical expression in an "if" statement with
parens in VBScript. So this will work in VBScript:

if (frm_quant = "") or not (frm_quant > 0 and frm_quant <= 100) then
your statements
end if
 
G

Guinness Mann

The $64,000 question - does php "short-circuit" it's If's?
Given the tests being done (value supplied, then value range),
I would suspect so, so we have to be a bit cleverer:

Good save, Phil!

-- Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,083
Messages
2,570,591
Members
47,212
Latest member
RobynWiley

Latest Threads

Top