Having recently upgraded to ver 06 and installed a couple of the mods from previous version, I thought I would check the various links within the admin_home.asp
When I click the link to Config Email Server the page does not display. I have checked the admin_home.asp links all seems okay, the admin_config_email.asp file is on the server.
I get the HTTP 500 - Internal server error Internet Explorer page can not be displayed.. The line in the admin_home.asp for the link is
I am sure nothing has been changed within the admin_config_email.asp file, i have even uploaded a fresh file from the zip file that was provided with version 06 Since I commented the beginning of line 183 it works But that doesnt explain why - has this routine been taken out?
' dim i, j j = 0 for i=0 to UBound(theComponent) if IsObjInstalled(theComponent(i)) then Response.Write " <option value=""" & theComponentValue(i) & """" & chkSelect(strMailMode,theComponentValue(i)) & ">" & theComponentName(i) & "</option>" & vbNewline else j = j + 1 end if
Edited by - Andy Humm on 19 February 2007 04:20:06
The code will work as expected. Variable declaration is optional in VbScript. You must have added a similar definition as a result of a mod to one of the included files, so I just commented these.
Alternatively you can just search the included files to check where the variables i was defined.
Since last post, I have looked at the original admin_config_email.asp file and there is not a comment at the begining of (line 183) dim i, j I have removed the comment and edited line 183 to read: dim j
(i.e. removed the i,) and the email config works! how strange
Edited by - Andy Humm on 18 February 2007 18:24:21
the reason that you are getting the problem is because you probably installed a MOD somewhere that is also using a dim i, it may not have anything todo with admin_config_email, but dimming a variable means you can not dim it anywhere else on your site.
Just a general note to the world - this is why we've moved along since the ZX80 days of single-character variable names (i, j) to things like intPageLayoutLoopCounter ;-)
single character variables still have their place when used for temporary loop counters there is no point in declaring a variable called intPageLayoutLoopCounter when i will suffice, variable names also take up application resources.
heh heh, ok I was taking an extreme case with a long variable name etc, and yes, i and j (and foo and bar) are the most common loop counters, but it does mean you can hit cases like the above, or hit other problems when you've not got the luxury of variant datatypes and end up trying to stuff a string into an int
Really, looking at the above, the problem and fix both come down to vbscript being extremely tolerent of datatype binding, which encourages sloppy practice, which leaves people confused with their first tightly-bound Option Strict app ;-)
yes, well vb and vbscript are not really good languages to write in for that and many other reasons which is why I prefer to use C# for my .Net stuff, it is a lot closer to what I am used to writing code in, VB is a bit toy town in comparison, but each to his own as they say
agreed - horses for courses to some degree as the languages are (historically) targetted at different audiences - whilst the C++ guys were allocating their first few bytes of memory, the VB guys presented a 'good enough' working prototype to the business users. It may have been 30% slower to run, but clock cycles are cheap now, and frankly the savings made by having the app today instead of next week make business analysts moist!
Also, in terms of code maintenence, C and C++ were often described as 'write only' languages
Performance-wise at runtime I do not percieve any real advantage to C# or VB.NET, but then again am less close to the code these days - do you see any strong advantage of one over the other now VB has matured a bit?
Since last post, I have looked at the original admin_config_email.asp file and there is not a comment at the begining of (line 183) dim i, j I have removed the comment and edited line 183 to read: dim j
(i.e. removed the i,) and the email config works! how strange
I dimmed line 183. Is this going to affect other Mods? I am using the:
Search Log Upgrade v1.0 -> 1.0.1 Mod Search Log v 1.0.1 Mod Crash's Hover Color Mod Site Integration Mod (turned off) and Logged in users who are active v3.3 and of course, edited the script in many places...
Also just noticed that my password reset mod is not working.