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.

ANY Variable and For Each looping

17 posts in Objects Last posting was on 2005-06-15 02:14:09.0Z
Bill Posted on 2005-06-14 20:00:54.0Z
Sender: 233d.42af3656.1804289383@sybase.com
From: Bill
Newsgroups: sybase.public.powerbuilder.objects
Subject: ANY Variable and For Each looping
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <42af3773.235b.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 14 Jun 2005 13:00:51 -0700, 10.22.241.42
Lines: 15
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 14 Jun 2005 13:00:52 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 14 Jun 2005 13:00:54 -0700
X-Trace: forums-1-dub 1118779254 10.22.108.75 (14 Jun 2005 13:00:54 -0700)
X-Original-Trace: 14 Jun 2005 13:00:54 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8454
Article PK: 735677

I am trying to replicate an ASP/VB script in powerbuilder
using automation server objects. The script below show that
if an error exists in the object then I'm trying to capture
the number of errors (its an ANY variable)

lb_errorexists = PBObject.ErrorExists
If lb_errorexists = True then

la_error_cnt = PBObject.Errors

else

In the sample script that I have it does a For Each
la_error_cnt in PBObject.Errors. How can this be done in
Powerbuilder


Doug Porter Posted on 2005-06-14 20:44:17.0Z
From: "Doug Porter" <doug_porterATdailyaccessDOTnospamDOTcom>
Newsgroups: sybase.public.powerbuilder.objects
References: <42af3773.235b.1681692777@sybase.com>
Subject: Re: ANY Variable and For Each looping
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Original-NNTP-Posting-Host: 12.6.74.54
Message-ID: <42af419d$1@forums-2-dub>
X-Original-Trace: 14 Jun 2005 13:44:13 -0700, 12.6.74.54
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 14 Jun 2005 13:44:14 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 14 Jun 2005 13:44:17 -0700
X-Trace: forums-1-dub 1118781857 10.22.108.75 (14 Jun 2005 13:44:17 -0700)
X-Original-Trace: 14 Jun 2005 13:44:17 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8455
Article PK: 735679

The For Each construct iterates a collection for you, so you would just have
to create a standard for loop to iterate your collection. If it were an
array it would be something like this.

for i=1 to UpperBound(PBObject.Errors)
la_error_cnt = PBObject.Errors[i]

//Do something with la_error_cnt
next

Doug Porter
DailyAccess Corporation

<Bill> wrote in message news:42af3773.235b.1681692777@sybase.com...
> I am trying to replicate an ASP/VB script in powerbuilder
> using automation server objects. The script below show that
> if an error exists in the object then I'm trying to capture
> the number of errors (its an ANY variable)
>
> lb_errorexists = PBObject.ErrorExists
> If lb_errorexists = True then
>
> la_error_cnt = PBObject.Errors
>
> else
>
> In the sample script that I have it does a For Each
> la_error_cnt in PBObject.Errors. How can this be done in
> Powerbuilder


Bill Posted on 2005-06-14 22:43:32.0Z
Sender: 2484.42af5ce9.1804289383@sybase.com
From: Bill
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: ANY Variable and For Each looping
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <42af5d91.2489.1681692777@sybase.com>
References: <42af419d$1@forums-2-dub>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 14 Jun 2005 15:43:29 -0700, 10.22.241.42
Lines: 40
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 14 Jun 2005 15:43:30 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 14 Jun 2005 15:43:32 -0700
X-Trace: forums-1-dub 1118789012 10.22.108.75 (14 Jun 2005 15:43:32 -0700)
X-Original-Trace: 14 Jun 2005 15:43:32 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8456
Article PK: 735680

Doug, I hate to ask stupid questions but what does the "i"
stand for when I tried to apply this I get the following
error message:

"reference arguement must be a non-constand and non-readonly
reference variable"

> The For Each construct iterates a collection for you, so
> you would just have to create a standard for loop to
> iterate your collection. If it were an array it would be
> something like this.
>
> for i=1 to UpperBound(PBObject.Errors)
> la_error_cnt = PBObject.Errors[i]
>
> //Do something with la_error_cnt
> next
>
> Doug Porter
> DailyAccess Corporation
>
> <Bill> wrote in message
> > news:42af3773.235b.1681692777@sybase.com... I am trying
> > to replicate an ASP/VB script in powerbuilder using
> > automation server objects. The script below show that
> if an error exists in the object then I'm trying to
> > capture the number of errors (its an ANY variable)
> >
> > lb_errorexists = PBObject.ErrorExists
> > If lb_errorexists = True then
> >
> > la_error_cnt = PBObject.Errors
> >
> > else
> >
> > In the sample script that I have it does a For Each
> > la_error_cnt in PBObject.Errors. How can this be done
> > in Powerbuilder
>
>