//Trim function
function trimAll(sString)
{
while (sString.substring(0,1) == ' ')
{
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ')
{
sString = sString.substring(0,sString.length-1);
}
return sString;
}
//Usage
if (trimAll(document.form1.txtForename.value)=="")
{
alert('Please enter ForeName');
document.form1.txtForename.focus();
return false;
}
////////////////////////////////////////////////////////////////
Wednesday, September 27, 2006
Wednesday, September 20, 2006
Wednesday, September 13, 2006
25 years ago......
25 years ago......
A program was ... a television show
An application was .. for employment
Windows were..... something u hated to clean
A cursor ... used profanity
A keyboard was ...a piano
Memory was..... something u lost with age
A CD was... a bank account
If u unzipped in public u went to jail
Compress was something u did to garbage
A hard drive was a long trip on the road
Log on was adding wood to fire
A backup happened to your toilet
A mouse pad was where a mouse lived
Cut.. u did with scissors
paste.. u did with glue
A web was a spiders home
And a virus was the flu!!
.. Times surely have changed :-)
A program was ... a television show
An application was .. for employment
Windows were..... something u hated to clean
A cursor ... used profanity
A keyboard was ...a piano
Memory was..... something u lost with age
A CD was... a bank account
If u unzipped in public u went to jail
Compress was something u did to garbage
A hard drive was a long trip on the road
Log on was adding wood to fire
A backup happened to your toilet
A mouse pad was where a mouse lived
Cut.. u did with scissors
paste.. u did with glue
A web was a spiders home
And a virus was the flu!!
.. Times surely have changed :-)
Monday, September 11, 2006
how to make 2D arrays in javascript??
A basic way to make a 2D array 20 by 20 is like this:
var UserBoard = new Array(20);
for(var i=0;i<=21;i++)
{
UserBoard[i]==new Array(20);
}
UserBoard[4,5]="test";
alert("test:" + UserBoard[4,5]);
Reason I'm posting this is just for reference purposes since I've been trying to do this for hours, thinking it was UserBoard[4][5] but it's UserBoard[4,5] that you access it by. Got this from here.
var UserBoard = new Array(20);
for(var i=0;i<=21;i++)
{
UserBoard[i]==new Array(20);
}
UserBoard[4,5]="test";
alert("test:" + UserBoard[4,5]);
Reason I'm posting this is just for reference purposes since I've been trying to do this for hours, thinking it was UserBoard[4][5] but it's UserBoard[4,5] that you access it by. Got this from here.
Split like function in SQL SERVER 2000
ALTER PROC dbo.USP_GET_OPERATOR_CHAT_MESSAGES_TESTING(
@ChatIds VARCHAR(500)
)
AS
--USP_GET_OPERATOR_CHAT_MESSAGES_TESTING '1071,1072'
SET NOCOUNT ON
BEGIN
DECLARE @Str Varchar (100)
DECLARE @tab TABLE (ID INT)
SET @Str = @ChatIds + ',' --'4,5,6,'- pls note the string ends with the delimited char i.e. comma
WHILE @str <> ''
BEGIN
INSERT INTO @TAB (ID)
SELECT SUBSTRING(@Str, 1, CHARINDEX (',', @Str) -1)
SET @str = SUBSTRING(@Str, CHARINDEX (',', @Str) + 1, LEN(@Str) - CHARINDEX (',', @Str))
END
SELECT MessageID, IsOperator, Message FROM tblChatMessage
WHERE ChatId IN (SELECT * FROM @tab) ORDER BY ChatID, MessageID
END
@ChatIds VARCHAR(500)
)
AS
--USP_GET_OPERATOR_CHAT_MESSAGES_TESTING '1071,1072'
SET NOCOUNT ON
BEGIN
DECLARE @Str Varchar (100)
DECLARE @tab TABLE (ID INT)
SET @Str = @ChatIds + ',' --'4,5,6,'- pls note the string ends with the delimited char i.e. comma
WHILE @str <> ''
BEGIN
INSERT INTO @TAB (ID)
SELECT SUBSTRING(@Str, 1, CHARINDEX (',', @Str) -1)
SET @str = SUBSTRING(@Str, CHARINDEX (',', @Str) + 1, LEN(@Str) - CHARINDEX (',', @Str))
END
SELECT MessageID, IsOperator, Message FROM tblChatMessage
WHERE ChatId IN (SELECT * FROM @tab) ORDER BY ChatID, MessageID
END
Subscribe to:
Posts (Atom)