Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Stuck on Function()

11 posts in General Discussion (old) Last posting was on 2000-03-23 16:50:37.0Z
^*^GothicCastle^*^ Posted on 2000-02-23 10:59:27.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 23 Feb 2000 10:59:27 +0000
From: ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Stuck on Function()
Content-Type: multipart/alternative; boundary="------------2AB7FF3BB989035E0BDA4D30"
Lines: 96
NNTP-Posting-Host: du-012-0238.freeuk.com 212.126.155.238
Message-ID: <347_38B3BD8F.38BA533E@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28095
Article PK: 159986

Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


Alain Bourque Posted on 2000-02-23 13:56:37.0Z
Newsgroups: sybase.public.easerver
From: "Alain Bourque" <abourque@garaga.com>
Subject: Re: Stuck on Function()
Date: Wed, 23 Feb 2000 08:56:37 -0500
Lines: 144
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_000F_01BF7DDB.E4624AE0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 67-164.tr.cgocable.ca 205.151.67.164
Message-ID: <347_W4DHrZgf$GA.202@forums.sybase.com>
References: <347_38B3BD8F.38BA533E@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28087
Article PK: 154623

Davlon,
Maybe try this ...
 
psDocument.WriteLn( day + " " + checkDates + " " + year)
 
 
^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...
Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


^*^GothicCastle^*^ Posted on 2000-02-23 14:20:35.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 23 Feb 2000 14:20:35 +0000
From: ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Stuck on Function()
Content-Type: multipart/alternative; boundary="------------AE5A63DAA8AA1B690F6A3689"
Lines: 158
NNTP-Posting-Host: du-012-0027.freeuk.com 212.126.155.27
Message-ID: <347_38B3ECB3.E93A967A@hotmail.com>
References: <347_38B3BD8F.38BA533E@hotmail.com> <347_W4DHrZgf$GA.202@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28085
Article PK: 159979

Alain,

Thanks for the reply. My total code is:

psDocument.WriteLn(psSession.GetParam("arr_day");
psDocument.WriteLn('" + checkDates + "');
psDocument.WriteLn(psSession.GetParam("arr_year")

At this moment returns:

01 " + checkDates + " 2000.

Now I could easily change the values in my previous page to display January, feb etc... but I will eventually have to convert these into numbers. This is because i want to pass the dates in as retrieval args into a datawindow. Unfortuantely, my javascripting skills aren't the same as my html or SQL skills so I'm a little stumped.

Any further ideas?

Alain Bourque wrote:

Davlon,Maybe try this ... psDocument.WriteLn( day + " " + checkDates + " " + year)  
^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


Tim Nesham Posted on 2000-02-23 15:32:51.0Z
Newsgroups: sybase.public.easerver
From: "Tim Nesham" <tim.nesham@born.com>
Subject: Re: Stuck on Function()
Date: Wed, 23 Feb 2000 09:32:51 -0600
Lines: 170
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_003A_01BF7DE0.F4655090"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Original-NNTP-Posting-Host: 161.49.6.89
Organization: Quad/Graphics,Inc.
NNTP-Posting-Host: dns2.qgraph.com 206.158.124.2
Message-ID: <347_38b3fda7@news.qgraph.com>
References: <347_38B3BD8F.38BA533E@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!news.qgraph.com!161.49.6.89
Xref: forums-1-dub sybase.public.easerver:28070
Article PK: 159964

Well, blatantly you're not passing the parm! :-)  But that is probably a typo.  I think it should be:
 
psDocument.WriteLn("01" + sortDates(month) + "2000");
 
sortDates(avar) {
var ls_ret;
switch  ( avar ) {
    case 1:
        ls_ret = "January";
        break;
    case 2:
    (ditto through case 12)
}
return ls_ret;
}
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...
Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


Tim Nesham Posted on 2000-02-23 15:35:59.0Z
Newsgroups: sybase.public.easerver
From: "Tim Nesham" <tim.nesham@born.com>
Subject: Re: Stuck on Function()
Date: Wed, 23 Feb 2000 09:35:59 -0600
Lines: 212
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0050_01BF7DE1.64448930"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Original-NNTP-Posting-Host: 161.49.6.89
Organization: Quad/Graphics,Inc.
NNTP-Posting-Host: dns2.qgraph.com 206.158.124.2
Message-ID: <347_38b3fe63@news.qgraph.com>
References: <347_38B3BD8F.38BA533E@hotmail.com> <347_38b3fda7@news.qgraph.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!news.qgraph.com!161.49.6.89
Xref: forums-1-dub sybase.public.easerver:28069
Article PK: 154621

Or for your case:
 
psDocument.WriteLn("01" + sortDates(month) + "2000");
sortDates() {
var ls_ret;
var avar = psSession.GetValue("arr_month");
switch  ( avar ) {
    case 1:
        ls_ret = "January";
        break;
    case 2:
    (ditto through case 12)
}
return ls_ret;
}
 
 
 
psDocument.WriteLn("01" + sortDates(month) + "2000");
 
sortDates(avar) {
var ls_ret;
switch  ( avar ) {
    case 1:
        ls_ret = "January";
        break;
    case 2:
    (ditto through case 12)
}
return ls_ret;
}
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...
Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


^*^GothicCastle^*^ Posted on 2000-02-23 17:34:28.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 23 Feb 2000 17:34:28 +0000
From: ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Stuck on Function()
Content-Type: multipart/alternative; boundary="------------FE9E4F4752AFD07F724CD4D8"
Lines: 202
NNTP-Posting-Host: du-012-0027.freeuk.com 212.126.155.27
Message-ID: <347_38B41A24.15829DDB@hotmail.com>
References: <347_38B3BD8F.38BA533E@hotmail.com> <347_38b3fda7@news.qgraph.com> <347_38b3fe63@news.qgraph.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28043
Article PK: 159944

Tim,

I've put in your code and I'm still getting

+ sortDates(Month) +

and not the value.

I'm assuming that this is client side Javascript?

Davlon

Tim Nesham wrote:

Or for your case: psDocument.WriteLn("01" + sortDates(month) + "2000");sortDates() {var ls_ret;var avar = psSession.GetValue("arr_month");switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}  
 psDocument.WriteLn("01" + sortDates(month) + "2000"); sortDates(avar) {var ls_ret;switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


Tim Nesham Posted on 2000-02-23 18:41:38.0Z
Newsgroups: sybase.public.easerver
From: "Tim Nesham" <tim.nesham@born.com>
Subject: Re: Stuck on Function()
Date: Wed, 23 Feb 2000 12:41:38 -0600
Lines: 245
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01BF7DFB.53821300"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Original-NNTP-Posting-Host: 161.49.6.89
Organization: Quad/Graphics,Inc.
NNTP-Posting-Host: dns2.qgraph.com 206.158.124.2
Message-ID: <347_38b429e5@news.qgraph.com>
References: <347_38B3BD8F.38BA533E@hotmail.com> <347_38b3fda7@news.qgraph.com> <347_38b3fe63@news.qgraph.com> <347_38B41A24.15829DDB@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!news.qgraph.com!161.49.6.89
Xref: forums-1-dub sybase.public.easerver:28040
Article PK: 159945

Most likely it is where you are putting your quotes.  Without seeing the actual file it is hard to tell.
If your code looks like: psDocument.WriteLn("01 + sortDates(month) + 2000"); then of course you get the result you mentioned.  But, psDocument.WriteLn("01" + sortDates(month) + "2000");  will not.  Send me the actual code if you like and I'll get it to work for you - free of charge!
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B41A24.15829DDB@hotmail.com...
Tim,

I've put in your code and I'm still getting

+ sortDates(Month) +

and not the value.

I'm assuming that this is client side Javascript?

Davlon

Tim Nesham wrote:

Or for your case: psDocument.WriteLn("01" + sortDates(month) + "2000");sortDates() {var ls_ret;var avar = psSession.GetValue("arr_month");switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}  
 psDocument.WriteLn("01" + sortDates(month) + "2000"); sortDates(avar) {var ls_ret;switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


^*^GothicCastle^*^ Posted on 2000-02-23 19:54:02.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 23 Feb 2000 19:54:02 +0000
From: ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Stuck on Function()
Content-Type: multipart/alternative; boundary="------------EAF627AB5E0298DC71D5DF48"
Lines: 252
NNTP-Posting-Host: du-004-0104.freeuk.com 212.126.149.104
Message-ID: <347_38B43ADA.BD0C8612@hotmail.com>
References: <347_38B3BD8F.38BA533E@hotmail.com> <347_38b3fda7@news.qgraph.com> <347_38b3fe63@news.qgraph.com> <347_38B41A24.15829DDB@hotmail.com> <347_38b429e5@news.qgraph.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28029
Article PK: 159929

Tim,

After much sticking of single quotes anywhere and everywhere, I managed to get it to work, my mistake was not putting single quotes before and after the case no:

case '01':
psDocument.WriteLn("January");

Anyway it all works now so thanks very much indeed!!

Now onto the next brick wall to hit my head against<g>

Davlon
 
 

Tim Nesham wrote:

 Most likely it is where you are putting your quotes.  Without seeing the actual file it is hard to tell.If your code looks like: psDocument.WriteLn("01 + sortDates(month) + 2000"); then of course you get the result you mentioned.  But, psDocument.WriteLn("01" + sortDates(month) + "2000");  will not.  Send me the actual code if you like and I'll get it to work for you - free of charge!
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B41A24.15829DDB@hotmail.com...Tim,

I've put in your code and I'm still getting

+ sortDates(Month) +

and not the value.

I'm assuming that this is client side Javascript?

Davlon

Tim Nesham wrote:

Or for your case: psDocument.WriteLn("01" + sortDates(month) + "2000");sortDates() {var ls_ret;var avar = psSession.GetValue("arr_month");switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}
 psDocument.WriteLn("01" + sortDates(month) + "2000"); sortDates(avar) {var ls_ret;switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


Tim Nesham Posted on 2000-02-23 20:35:47.0Z
Newsgroups: sybase.public.easerver
From: "Tim Nesham" <tim.nesham@born.com>
Subject: Re: Stuck on Function()
Date: Wed, 23 Feb 2000 14:35:47 -0600
Lines: 267
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_001A_01BF7E0B.45EE5310"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Original-NNTP-Posting-Host: 161.49.6.89
Organization: Quad/Graphics,Inc.
NNTP-Posting-Host: dns2.qgraph.com 206.158.124.2
Message-ID: <347_38b444a6@news.qgraph.com>
References: <347_38B3BD8F.38BA533E@hotmail.com> <347_38b3fda7@news.qgraph.com> <347_38b3fe63@news.qgraph.com> <347_38B41A24.15829DDB@hotmail.com> <347_38b429e5@news.qgraph.com> <347_38B43ADA.BD0C8612@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!news.qgraph.com!161.49.6.89
Xref: forums-1-dub sybase.public.easerver:28021
Article PK: 159920

Yea, I sympathize. I got the same dents in my head.  Also note that generic methods can be put in a separate file and included with:
<SCRIPT src="Script/tabs.js">
 
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B43ADA.BD0C8612@hotmail.com...
Tim,

After much sticking of single quotes anywhere and everywhere, I managed to get it to work, my mistake was not putting single quotes before and after the case no:

case '01':
psDocument.WriteLn("January");

Anyway it all works now so thanks very much indeed!!

Now onto the next brick wall to hit my head against<g>

Davlon
 
 

Tim Nesham wrote:

 Most likely it is where you are putting your quotes.  Without seeing the actual file it is hard to tell.If your code looks like: psDocument.WriteLn("01 + sortDates(month) + 2000"); then of course you get the result you mentioned.  But, psDocument.WriteLn("01" + sortDates(month) + "2000");  will not.  Send me the actual code if you like and I'll get it to work for you - free of charge!
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B41A24.15829DDB@hotmail.com...Tim,

I've put in your code and I'm still getting

+ sortDates(Month) +

and not the value.

I'm assuming that this is client side Javascript?

Davlon

Tim Nesham wrote:

Or for your case: psDocument.WriteLn("01" + sortDates(month) + "2000");sortDates() {var ls_ret;var avar = psSession.GetValue("arr_month");switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}
 psDocument.WriteLn("01" + sortDates(month) + "2000"); sortDates(avar) {var ls_ret;switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


^*^GothicCastle^*^ Posted on 2000-02-23 16:44:58.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 23 Feb 2000 16:44:58 +0000
From: ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Stuck on Function()
Content-Type: multipart/alternative; boundary="------------EA3A0068964614B787FF58C5"
Lines: 205
NNTP-Posting-Host: du-012-0027.freeuk.com 212.126.155.27
Message-ID: <347_38B40E8A.2855095@hotmail.com>
References: <347_38B3BD8F.38BA533E@hotmail.com> <347_38b3fda7@news.qgraph.com> <347_38b3fe63@news.qgraph.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28059
Article PK: 159955

Tim,
Many Thanks for the code!  I've never come across either switch or case before in web programming, is this a PowerBuilder coding? In addition is this code best as Server side or client side script?

Davlon

Tim Nesham wrote:

Or for your case: psDocument.WriteLn("01" + sortDates(month) + "2000");sortDates() {var ls_ret;var avar = psSession.GetValue("arr_month");switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}  
 psDocument.WriteLn("01" + sortDates(month) + "2000"); sortDates(avar) {var ls_ret;switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon


Dave Wolf [Sybase] Posted on 2000-03-23 16:50:37.0Z
Newsgroups: sybase.public.easerver
From: "Dave Wolf [Sybase]" <dwolf@sybase.com>
Subject: Re: Stuck on Function()
Date: Thu, 23 Mar 2000 11:50:37 -0500
Lines: 229
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_00C0_01BF94BE.01014220"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: dwolf-nt.sybase.com 157.133.41.127
Message-ID: <347_Vlvwe6hf$GA.274@forums.sybase.com>
References: <347_38B3BD8F.38BA533E@hotmail.com> <347_38b3fda7@news.qgraph.com> <347_38b3fe63@news.qgraph.com> <347_38B40E8A.2855095@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28056
Article PK: 159951

Case statements are common in C, C++, Java, and PB. 

Dave Wolf
Internet Applications Division
 
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B40E8A.2855095@hotmail.com...
Tim,
Many Thanks for the code!  I've never come across either switch or case before in web programming, is this a PowerBuilder coding? In addition is this code best as Server side or client side script?

Davlon

Tim Nesham wrote:

Or for your case: psDocument.WriteLn("01" + sortDates(month) + "2000");sortDates() {var ls_ret;var avar = psSession.GetValue("arr_month");switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}  
 psDocument.WriteLn("01" + sortDates(month) + "2000"); sortDates(avar) {var ls_ret;switch  ( avar ) {    case 1:        ls_ret = "January";        break;    case 2:    (ditto through case 12)}return ls_ret;}
"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message news:38B3BD8F.38BA533E@hotmail.com...Below is a sample of my code. I wish to convert a numeric value for my month into a word ie 01 into January. I have a variable that points to a function, and this function is full of if...else statements. I then call on that variable to display the value and all I get is the following displayed:

01 " + checkDates + " 2000

Code:

var checkDates = sortDates();

sortDates() {
if (psSession.GetValue("arr_month"); == 1 ) {
psDocument.WriteLn("January");
} else if (psSession.GetValue("arr_month"); == 2 ) {
psDocument.WriteLn("Febuary");
} else if (psSession.GetValue("arr_month"); == 3 ) {
psDocument.WriteLn("March");
} else if (psSession.GetValue("arr_month"); == 4 ) {
psDocument.WriteLn("April");
} else if (psSession.GetValue("arr_month"); == 5 ) {
psDocument.WriteLn("May");
} else if (psSession.GetValue("arr_month"); == 6 ) {
psDocument.WriteLn("June");
} else if (psSession.GetValue("arr_month") == 7 ) {
psDocument.WriteLn("July");
} else if (psSession.GetValue("arr_month"); == 8 ) {
psDocument.WriteLn("August");
} else if (psSession.GetValue("arr_month"); == 9 ) {
psDocument.WriteLn("September");
} else if (psSession.GetValue("arr_month"); == 10 ) {
psDocument.WriteLn("October");
} else if (psSession.GetValue("arr_month"); == 11 ) {
psDocument.WriteLn("November");
} else if (psSession.GetValue("arr_month"); == 12 ) {
psDocument.WriteLn("December");
}
}

I then call it via this code:

psDocument.WriteLn('" + checkDates + "');

I'm obviously doing something blatantly wrong can anyone put me in the right direction...? Or if anyone knows a better way to do this then I'd be grateful.

Thanks

Davlon