-
-
I Mastered Dead Technology
= is an assignment operate
i.e. :
zipcode = 5;
will tell flash that the variable zipcode equals 5
== is a test for equality.
zipcode == 5;
will tell flash to figure out if zipcode equals 5.
in if statements you are almost always going to use ==
if (zipcode >=0100 && zipcode<=01099){
message = "THE ZIP CODE YOU ENTERED IS WITHIN THE 24HS ZONE";
}else if{
and so on
what I think might work is
if ( (zipcode >= 0100) && (zipcode <=01099) ){
message = "THE ZIP CODE YOU ENTERED IS WITHIN THE 24HS ZONE";
}esle if{
ONLY RON PAUL AND ALUMINUM FOIL CAN SAVE YOU NOW!
annoy your politician fairtax.org, a political forum
Catapultam habeo. Nisi pecuniam omnem mihi dabris, ad caput tuum saxum immane mittam.
-
Hi,
I dont know whether flash knows about octal numbers ... most languages would interpret something starting with 0 as an octal number, like they interpret something starting with 0x as a hex number. Now, 01099 is invalid in octal..
Your best choice would be to treat zip codes as strings, and compare them like
if(zip >= '01000' && zip <= '01099')
Musicman.
-
So I just need to enter my zip code range between "" and it will be treated as string??
This is an example of what I need to do:
01000-01099
01500-01599
20031-20090
50054-60010
[/B]
If the entered zip code is within one of those range of zipcodes it means that the shipment can be deliverd within 24hs. What if the entered zipcode is not in those ranges??? How can I set an action to verify if the zipcode is not serviced within 24hs???
I know that I can set somethin like:
if (zipcode >=01000 && zipcode<=01099){
message = "THE ZIP CODE YOU ENTERED IS WITHIN THE 24HS ZONE";
}else if (zipcode >01099){
message = "THE ZIP CODE YOU ENTERED IS NOT WITHIN THE 24HS ZONE";
//and then start another range..
IS THERE ANY EASIER WAY????
====================
I love this forum!!!
Pilot_22
====================
-
Hi,
I would consider this way:
Code:
zips = [
{from:'10000', to:'10099'},
{from:'15000', to:'15099'},
...];
ok = false;
for(n = 0 ; n < zips.length ; n++)
if(zip >= zips[n].from && zip <= zips[n].to)
{ ok = true;
break;
}
if(ok) // customer gets fast service
Musicman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|