1. setindex error

If you have a create type of 'list' and because of whatever data reasons
there are no items to display in the list I'm getting a setindex error from
win32. How do you avoid this? setIndex of 1 or 0 doesen't work. Do I have to
add a dummy item to the list saying something like "  **** no items found
***" and set the indes to 1??

...george

new topic     » topic index » view message » categorize

2. Re: setindex error

George,

Why do you want to set the index if there is nothing in the list?  Why not
do something like this:

if length(ListWhatever) > 0 then
    setIndex(ListWhatever, 1)
end if

That way, if there's nothing in the List, you won't get the error.

Virtual B

----- Original Message -----
From: George Walters <gwalters at sc.rr.com>
To: EUforum <EUforum at topica.com>
Sent: Monday, August 27, 2001 8:07 AM
Subject: setindex error


>
> If you have a create type of 'list' and because of whatever data reasons
> there are no items to display in the list I'm getting a setindex error
from
> win32. How do you avoid this? setIndex of 1 or 0 doesen't work. Do I have
to
> add a dummy item to the list saying something like "  **** no items found
> ***" and set the indes to 1??
>
> ...george
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: setindex error

OOPS...That should be getCount(ListWhatever) instead of
length(ListWhatever).  Sorry.  That's what happens when I try to send mail
from work!  :)

Virtual B

----- Original Message -----
From: Virtual B <behaviorself at netzero.net>
Subject: Re: setindex error


>
> George,
>
> Why do you want to set the index if there is nothing in the list?  Why not
> do something like this:
>
> if length(ListWhatever) > 0 then
>     setIndex(ListWhatever, 1)
> end if
>
> That way, if there's nothing in the List, you won't get the error.
>
> Virtual B
>
> ----- Original Message -----
> From: George Walters <gwalters at sc.rr.com>
> To: EUforum <EUforum at topica.com>
> Sent: Monday, August 27, 2001 8:07 AM
> Subject: setindex error
>
>
> > If you have a create type of 'list' and because of whatever data reasons
> > there are no items to display in the list I'm getting a setindex error
> from
> > win32. How do you avoid this? setIndex of 1 or 0 doesen't work. Do I
have
> to
> > add a dummy item to the list saying something like "  **** no items
found
> > ***" and set the indes to 1??
> >
> > ...george
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: setindex error

VB, that was what I what I was doing. Here's the only code I could get to
work...similar to yours.

 if EOF then
   if getCount(idCust)>0 then
    setIndex(idCust,1)
   else
    addItem(idCust,"*** none on fille ***")
   end if
   exit

w/o the '*** none on file ***' I get the setindex error

...george
----- Original Message -----
From: "Virtual B" <behaviorself at netzero.net>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, August 27, 2001 3:18 PM
Subject: Re: setindex error


>
> George,
>
> Why do you want to set the index if there is nothing in the list?  Why not
> do something like this:
>
> if length(ListWhatever) > 0 then
>     setIndex(ListWhatever, 1)
> end if
>
> That way, if there's nothing in the List, you won't get the error.
>
> Virtual B
>
> ----- Original Message -----
> From: George Walters <gwalters at sc.rr.com>
> To: EUforum <EUforum at topica.com>
> Sent: Monday, August 27, 2001 8:07 AM
> Subject: setindex error
>
>
> > If you have a create type of 'list' and because of whatever data reasons
> > there are no items to display in the list I'm getting a setindex error
> from
> > win32. How do you avoid this? setIndex of 1 or 0 doesen't work. Do I
have
> to
> > add a dummy item to the list saying something like "  **** no items
found
> > ***" and set the indes to 1??
> >
> > ...george
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: setindex error

George,
is the message you are getting this one....?

    sendMessage(#1) in setIndex failed.

if so, you can edit the win32lib.ew file as this is only a warning message
(setting the index for an empty list is not a logical thing to do, I guess).

Locate the text that looks like ...

    if sendMessage( id, msg, index-1, 0 ) = -1
    and index != 0 then
    warnErr( sprintf("sendMessage(#%x) in setIndex failed.", {msg} ) )
    end if

and replace it with ...

    VOID = sendMessage( id, msg, index-1, 0 )

----
Derek.

----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, August 28, 2001 1:07 AM
Subject: setindex error


>
> If you have a create type of 'list' and because of whatever data reasons
> there are no items to display in the list I'm getting a setindex error
from
> win32. How do you avoid this? setIndex of 1 or 0 doesen't work. Do I have
to
> add a dummy item to the list saying something like "  **** no items found
> ***" and set the indes to 1??
>
> ...george
>
>
>

new topic     » goto parent     » topic index » view message » categorize

6. Re: setindex error

Hi Derek, yes that is the message. I'll look at making that change. If
you're interested, when you do get this message I've not been able to click
one of those buttons to get out. The same window  keeps showing up shifted
toward the lower right.



...george

----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: setindex error


>
> George,
> is the message you are getting this one....?
>
>     sendMessage(#1) in setIndex failed.
>
> if so, you can edit the win32lib.ew file as this is only a warning message
> (setting the index for an empty list is not a logical thing to do, I
guess).
>
> Locate the text that looks like ...
>
>     if sendMessage( id, msg, index-1, 0 ) = -1
>     and index != 0 then
>     warnErr( sprintf("sendMessage(#%x) in setIndex failed.", {msg} ) )
>     end if
>
> and replace it with ...
>
>     VOID = sendMessage( id, msg, index-1, 0 )
>
> ----
> Derek.
>
> ----- Original Message -----
> From: "George Walters" <gwalters at sc.rr.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Tuesday, August 28, 2001 1:07 AM
> Subject: setindex error
>
>
> > If you have a create type of 'list' and because of whatever data reasons
> > there are no items to display in the list I'm getting a setindex error
> from
> > win32. How do you avoid this? setIndex of 1 or 0 doesen't work. Do I
have
> to
> > add a dummy item to the list saying something like "  **** no items
found
> > ***" and set the indes to 1??
> >
> > ...george
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

7. Re: setindex error

George,

Are you sure there isn't another setIndex() somewhere?  I tried this code
and didn't get an error.

Virtual B
----- Original Message -----
From: George Walters <gwalters at sc.rr.com>
Subject: Re: setindex error


>
> VB, that was what I what I was doing. Here's the only code I could get to
> work...similar to yours.
>
>  if EOF then
>    if getCount(idCust)>0 then
>     setIndex(idCust,1)
>    else
>     addItem(idCust,"*** none on fille ***")
>    end if
>    exit
>
> w/o the '*** none on file ***' I get the setindex error
>
> ...george
> ----- Original Message -----
> From: "Virtual B" <behaviorself at netzero.net>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, August 27, 2001 3:18 PM
> Subject: Re: setindex error
>
>
> > George,
> >
> > Why do you want to set the index if there is nothing in the list?  Why
not
> > do something like this:
> >
> > if length(ListWhatever) > 0 then
> >     setIndex(ListWhatever, 1)
> > end if
> >
> > That way, if there's nothing in the List, you won't get the error.
> >
> > Virtual B
> >
> > ----- Original Message -----
> > From: George Walters <gwalters at sc.rr.com>
> > To: EUforum <EUforum at topica.com>
> > Sent: Monday, August 27, 2001 8:07 AM
> > Subject: setindex error
> >
> >
> > > If you have a create type of 'list' and because of whatever data
reasons
> > > there are no items to display in the list I'm getting a setindex error
> > from
> > > win32. How do you avoid this? setIndex of 1 or 0 doesen't work. Do I
> have
> > to
> > > add a dummy item to the list saying something like "  **** no items
> found
> > > ***" and set the indes to 1??
> > >
> > > ...george
> > >
> > >
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu