473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with script

Can someone please help me with the below script? I think it's nearly
correct but there's just something not quite right which won't let it
run.

Thanks in anticipation.

Mark

__________________________________________________ ______________

switch (article_get_field('style')) {
case 'Short':
switch (article_get_field('size')) {
case 'M':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC11M');
break;
case 'L':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC11L');
break;
case 'XL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC11XL');
break;
case 'XXL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC11XXL');
break;
break;
case 'Medium':
switch (article_get_field('size')) {
case 'M':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC10M');
break;
case 'L':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC10L');
break;
case 'XL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC10XL');
break;
case 'XXL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC10XXL');
break;
break;
case 'Long':
switch (article_get_field('size')) {
case 'M':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC1M');
break;
case 'L':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC1L');
break;
case 'XL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC1XL');
break;
case 'XXL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC1XXL');
break;
break;
}

Sep 15 '05 #1
3 1034
Mark said the following on 15/09/2005 16:55:
Can someone please help me with the below script? I think it's nearly
correct but there's just something not quite right which won't let it
run.
Why don't you just turn error reporting on, and it will tell you about
syntax errors.

You are missing the closing scope bracket "}" for each nested switch
statement.
Mark

__________________________________________________ ______________

switch (article_get_field('style')) {
case 'Short':
switch (article_get_field('size')) {
case 'M':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC11M');
break;
case 'L':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC11L');
break;
case 'XL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC11XL');
break;
case 'XXL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC11XXL');
break; } break;
case 'Medium':
switch (article_get_field('size')) {
case 'M':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC10M');
break;
case 'L':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC10L');
break;
case 'XL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC10XL');
break;
case 'XXL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC10XXL');
break; } break;
case 'Long':
switch (article_get_field('size')) {
case 'M':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC1M');
break;
case 'L':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC1L');
break;
case 'XL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC1XL');
break;
case 'XXL':
article_set_field('price', 0.00);
article_set_field('item_number', 'HC1XXL');
break; } break;
}

--
Oli
Sep 15 '05 #2
Thanks Oli,

The system I am using doesn't have error reporting other than stating
it isn't correct!
which as I'm sure you will agree is pretty useless.

I'll have a go

Mark

Sep 15 '05 #3
Mark said the following on 15/09/2005 17:07:
Thanks Oli,

The system I am using doesn't have error reporting other than stating
it isn't correct!
which as I'm sure you will agree is pretty useless.


Put:

error_reporting(E_ALL);

at the top of your scripts.

--
Oli
Sep 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
4
by: Derek | last post by:
I have the following script in a page and it gets an error in IE 6. Says something about an invalid argument but the line number doesn't help since I can't see the javascript code when viewing...
7
by: mike | last post by:
Hello, I am kind of new to this javascript stuff and I am constantly having problems trying to get my webpage validated. I have the following <script>printdate();</script> and when I validate it...
5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
4
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.