Welcome! Log In Create A New Profile

Advanced

Debugging Question

Posted by Joanna 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Debugging Question
September 01, 2007 09:39PM
Hi,

Is there a way to display field content of variable values for debugging purposes?

I am doing task 3C-1... with a switch in it... the code looks right to me, but I've obviously got a bug in it somewhere. In an effort to try and find it I have forced a location in the ChgMe function and that works, so it's not the location coding. What I then was trying to do was to somehow display exactly what case is being returned by the function... is there some magic command to do this, I tried using an alert, but I don't seem to be able to make the magic combination that is going to display the value in SelectedIndex? Is there another debugging technique that might be of use?

Thanks again for your help!

PS I managed to get IEv6 talking to me by changing the security settings. But Firefox is still being ugly to me!
TvD
Re: Debugging Question
September 02, 2007 06:26AM
yes the alert (you can include numerical variables as well)

var country = "Fiji";
var city = "Suva";
alert('The city of ' + city + ' is located in ' + country + '.'winking smiley;

or

alert('This is what an alert message looks like.'winking smiley;

If anyone intends to make a living out of programming JavaScript one day the best editor is here (Antechinus JavaScript Editor):

http://www.c-point.com/index.html
Re: Debugging Question
September 02, 2007 04:43PM
Hmm, the basic alert I understand... my problem is I don't seem to be able to display a system variable ie SelectedIndex - I tried
alert(document.listform.urlselect.selectedindex) but the alert doesn't happen in the browser. If I put the document.listform.urlselect.selectedindex in quotes then obviously it sees a string and the alert happens happily, but with the string displaying not the value of selected index. I tried making my own variable equal to document.listform.urlselect.selectedindex, and then dislaying that in the alert, but once again the alert doesn't happen...? I'll take a look at Antechinus... it just occurred to me if I am trying to display just a value do I need to have + on both sides of the stated variable... as in your example + country +, I thought the + was just for concatenation purposes... ?

I'll give it a bash...

Thanks again
TvD
Re: Debugging Question
September 03, 2007 07:30AM
yes the + is for concatenation
document.listform.urlselect.selectedindex? - post the code that you are using
Sorry, only registered users may post in this forum.

Click here to login