View Full Version : Need a second look is my syntax wrong, and how?
slafta
06-04-2005, 03:10 AM
proxy1 = Registry.GetValue(HKEY_CURRENT_USER, "\\Software\\Microsoft\\Windows\\CurrentVersion\\In ternet Settings", "ProxyEnable", true);
proxy2 = Registry.GetValue(HKEY_CURRENT_USER, "\\Software\\Microsoft\\Windows\\CurrentVersion\\In ternet Settings", "ProxyServer", true);
__________________________________________________ ________
if (proxy1 = 1) then
posproxyresponse1 = Dialog.Message("Scan in progress...", "It appears that you do have an active proxy", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
posproxyresponse3 = Dialog.Message("Proxy Settings",proxy2 , MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
posproxyresponse2 = Dialog.Message("Scan in progress...", "It appears that you do not have an active proxy", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
so proxy1 return long int, how is requiring a ' near the equal statement
Corey
06-04-2005, 03:20 AM
Hi. Try this:
if proxy1 == 1 then
instead of this:
if (proxy1 = 1) then
Hope that helps. :)
slafta
06-04-2005, 04:47 AM
thanks corey but I recoded it like this:
initproxysequence = Dialog.Message("Scan in progress...", "Do you have a proxy? 0=false 1=true", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
proxy1 = 0;
proxy2 = 0;
proxy1 = Registry.GetValue(HKEY_CURRENT_USER, "\\Software\\Microsoft\\Windows\\CurrentVersion\\In ternet Settings", "ProxyEnable", true);
proxy2 = Registry.GetValue(HKEY_CURRENT_USER, "\\Software\\Microsoft\\Windows\\CurrentVersion\\In ternet Settings", "ProxyServer", true);
proxycompare = String.CompareNoCase(proxy1, "0");
if (proxycompare ~= 0) then
posproxyresponse1 = Dialog.Message("Scan in progress...", "It appears that you do have an active proxy", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
posproxyresponse3 = Dialog.Message("Proxy Settings",proxy2 , MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
posproxyresponse2 = Dialog.Message("Scan in progress...", "No proxy detected!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
--------------------------------------------------------------------------------------------------------------------------------
--Proxy sub-routine works in live environment - 6/4/05 4:59 am
--------------------------------------------------------------------------------------------------------------------------------
however
the new routine it failing its the same thig but I tired the previous suggestions? what is ~= compare to ==
Intrigued
06-04-2005, 10:38 AM
what is ~= compare to ==
See: http://www.indigorose.com/webhelp/ams50/Scripting_Guide/Expressions_and_Operators.htm
csd214
06-04-2005, 01:50 PM
Registry.GetValue() returns a STRING; not a numeric value. It is important to be aware of the returned type of value. Don't mix string variables with numeric variables.
I'm not familiar with the Proxy values, but maybe you need omething like this:
proxy1 = Registry.GetValue(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Inte rnet Settings", "ProxyEnable", true);
if proxy1 ~= "0" then
-- not equal "0"
bServerKeyExist = Registry.DoesKeyExist(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Inte rnet Settings");
if bServerKeyExist then
-- get the settings
proxy2 = Registry.GetValue(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Inte rnet Settings", "ProxyServer", true);
Dialog.Message("Proxy", "Enabled = "..proxy1..
"\r\nServer = "..proxy2,MB_OK, MB_ICONINFORMATION);
else
Dialog.Message("Proxy", "Enabled = "..proxy1..
"\r\nNo Proxy Server found", MB_OK, MB_ICONINFORMATION);
end
else
-- equal "0"
Dialog.Message("Proxy", "No proxy detected!", MB_OK, MB_ICONINFORMATION);
end
HTH
Corey
06-04-2005, 03:22 PM
Yes csd is right, if you look up any action in the User's Guide you will see a "Returns" section which describes what type of value any given function returns, i.e. string, table, boolean, etc... :yes
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.