Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Level:Benign gives Illegal Operation Error

0 views
Skip to first unread message

Johan van Zyl

unread,
Jul 25, 2001, 5:47:56 AM7/25/01
to
Hi All
In a procedure/function when Level:Benign (or = 0 ) is returned it causes
Illegal Operation Error.
Level:Notify and Fatal - NO Problem
If Something
LOC:ReturnValue=Level:Notify
else
LOC:ReturnValue=Level:Benign
end
Return(Loc:ReturnValue)
If it is 0 0r Benign THEN big Problem!!!!
How do I solve this?
Thanks
---
Johan van Zyl
JVZ Systems CC - Reg No CK1990/006660/23
PO Box 3469 Somerset West 7129
Tel (021) 851 7205 Fax (021) 851 4204
Cell 082 875 4238
Customised Software and Support - Created in Clarion
RDBMS using MS SQL
DenTec2000 - Dental Technician Practice Management/Debtors
Premium, Debit Order and Claims Management
for Short Term Insurance Brokers and Hospital Plan Administrators
Retirement Planning Calc - Download from our web site.
jo...@jvz.co.za http://www.jvz.co.za
dav...@jvz.co.za
Let Every Matter be Established
http://www.truthorfiction.com

Jim Kane

unread,
Jul 25, 2001, 8:41:28 AM7/25/01
to
In article <3b5e...@news.softvelocity.com>, Johan van Zyl wrote:
> If it is 0 0r Benign THEN big Problem!!!!
>
You'll need to give the details of the method including prototype. It
likely has nothing to do with the actual return value itself. If your
using abc class methods be sure you have _abcdllmode_ and _abclinkmode_
set
----------------------------------
Jim Kane
Team SoftVelocity
Productive Software Solutions
Cant find the message?
Get Organized, Get ForKeeps
www.fkeeps.com


Johan van Zyl - JVZ Systems CC

unread,
Jul 25, 2001, 9:14:02 AM7/25/01
to

Prototype
(string,*string,*long,<long>,string),Long
Parameters
(TRAType,*ScrVar,*BUMId,UserID,Lookup)
Return Value
LOC:ReturnValue

Code calling this procedure

Init
!--- Setup the Screen to display the BUMID
If PTX:BUMID ~= 0
a#=SelectBNU(PTX:TRAType,lv:Analysis,PTX:BUMID,Glo:UsrID,'N')
End !if


Capture Variable Accepted Button
!---Check if What has been captured is Found in the BUM ID
ThisWindow.Update ! Update the Buffers from the Screen
Save# = PTX:BUMID ! Save Previous Value of BUMID
PTX:BUMID = 0 ! Reset it for Lookup Purposes
If SelectBNU(PTX:TRAType,lv:Analysis,PTX:BUMID,Glo:UsrID,'N') ~=
Level:Benign
Message('This is Not a Valid BUM Code. Please capture a Correct
value or |use the Lookup to Assist you.')
Select(?)
Cycle
End

Event Button Accepted "..."
!--- Force a Selection of the BNU Codes for the system
SelectBNU(PTX:TRAType,lv:Analysis,PTX:BUMID,Glo:UsrID,'Y')

Thanks
JVZ

Johan van Zyl - Somerset West - South Africa
jo...@jvz.co.za http://www.jvz.co.za
DenTec2000 - Short Term Insurance Broker Applications - Pastel Dealer
Hospital Plan - Premium, Debit Order and Claims Management
Retirement Planning Calc - Download form our web site.
Using CPD 2.110, CW5EEb ABC
File Manager 2, Wise Installation
Clarion/Pastel Accounting Systems discussion list
to join: http://cwpastel.listbot.com
e-mail to cwpa...@listbot.com
Clarion/MS SQL Discussion List
to join: http://clarionmssql.listbot.com or http://www.jvz.co.za/mssql
e-mail to clario...@listbot.com

Michael Ware

unread,
Jul 25, 2001, 11:11:15 AM7/25/01
to
Johan,
Do you know if the illegal operation is generated for each of the three
different uses you list, or is it just one of them that is causing the
problem??

-Mike

(p.s. Add ,PROC to your prototype to avoid the "calling function as
procedure" compiler error)

Johan van Zyl - JVZ Systems CC <jo...@jvz.co.za> wrote in message
news:3b5ec553...@news.softvelocity.com...

Johan van Zyl - JVZ Systems CC

unread,
Jul 25, 2001, 3:50:36 PM7/25/01
to
Thanks for your reply and advice - see my comments below

On Wed, 25 Jul 2001 11:11:15 -0400, "Michael Ware" <war...@tabinc.com>
wrote:

>Johan,
>Do you know if the illegal operation is generated for each of the three
>different uses you list, or is it just one of them that is causing the
>problem??
>
>-Mike
>
>(p.s. Add ,PROC to your prototype to avoid the "calling function as
>procedure" compiler error)
>
>
>
>Johan van Zyl - JVZ Systems CC <jo...@jvz.co.za> wrote in message
>news:3b5ec553...@news.softvelocity.com...
>>
>>
>> Prototype
>> (string,*string,*long,<long>,string),Long
>> Parameters
>> (TRAType,*ScrVar,*BUMId,UserID,Lookup)
>> Return Value
>> LOC:ReturnValue
>>
>> Code calling this procedure
>>
>> Init
>> !--- Setup the Screen to display the BUMID

>> If PTX:BUMID ~= 0

Causes error


>> a#=SelectBNU(PTX:TRAType,lv:Analysis,PTX:BUMID,Glo:UsrID,'N')
>> End !if
>>
>>
>> Capture Variable Accepted Button
>> !---Check if What has been captured is Found in the BUM ID
>> ThisWindow.Update ! Update the Buffers from the Screen
>> Save# = PTX:BUMID ! Save Previous Value of BUMID
>> PTX:BUMID = 0 ! Reset it for Lookup Purposes

This one does have a problem if = Benign


>> If SelectBNU(PTX:TRAType,lv:Analysis,PTX:BUMID,Glo:UsrID,'N') ~=
>> Level:Benign
>> Message('This is Not a Valid BUM Code. Please capture a Correct
>> value or |use the Lookup to Assist you.')
>> Select(?)
>> Cycle
>> End
>>

This one - no problem as it calls a lookuo from where the values are
chosen - even if level benign - no problem

Jim Kane

unread,
Jul 25, 2001, 8:08:42 PM7/25/01
to
In article <3b5ec553...@news.softvelocity.com>, Johan van Zyl -
JVZ Systems CC wrote:
> If PTX:BUMID ~= 0
> a#=SelectBNU(PTX:TRAType,lv:Analysis,PTX:BUMID,Glo:UsrID,'N')
> End !if
>
if ptx is a file and the file is not open yet, that may be the problem.
Also in your parameter list, it is unusual to have have *something as a
prameter name.

Johan van Zyl - JVZ Systems CC

unread,
Jul 26, 2001, 1:18:54 AM7/26/01
to
Hi
I have a procedure to test this procedure/function
I call it with
LOC:ReturnValue=SelectBNU(LOC:TraType,LOC:ScrVar,LOC:BumID,LOC:USRId,LOC:Lookup)
display

And here is the code in the function
IF Lookup <>'Y'
If BUMId<>0
BUM:BUMID=BUMId
if Access:BUM.Fetch(BUM:Key:BUMID_PK)!<> LEVEL:Benign
!message('LOC:ReturnValue=level:notify')
LOC:ReturnValue=level:notify
return(LOC:ReturnValue)
else

ScrVar=clip(BUM:Level1)&'/'&clip(BUM:Level2)&'/'&clip(BUM:Level3)&clip(BUM:Level4)&'/'&clip(BUM:Level5)&'/'&clip(BUM:Level6)|

&clip(BUM:Level7)&'/'&clip(BUM:Level8)&'/'&clip(BUM:Level9)&clip(BUM:Level10)
Do PrettyUp
LOC:ReturnValue=Level:Benign
!message('LOC:ReturnValue=
'&LOC:ReturnValue&'|'&LOC:ReturnLevels)
Return(LOC:ReturnValue)
end
end

If clip(ScrVar)<>''
Do ParseScrVarIn
If sub(ScrVar,len(clip(ScrVar)),1)='/'
ScrVar=ScrVar[1 : (len(clip(ScrVar))-1)]
end
!message('After ParseScrVarIn')
IF Access:BUM.Fetch(BUM:Key:Level1_10)!<> LEVEL:Benign
!message('LOC:ReturnValue=level:notify')
LOC:ReturnValue=level:notify
return(LOC:ReturnValue)
else
!message('LOC:ReturnValue=level:benign')
BumID=BUM:BUMID
!message(ScrVar&' After Routine')
!message(BumID&' '&clip(BUM:Level1)&'
'&clip(BUM:Level2)&' '&clip(BUM:Level3))
LOC:ReturnValue=Level:Benign
Return(LOC:ReturnValue)
end
end
end

Only causes error if level:benign or if LOC:ReturnValue=0
Thanks for all you responses
JVZ

Johan van Zyl - Somerset West - South Africa

Michael Ware

unread,
Jul 26, 2001, 10:15:17 AM7/26/01
to
Johan,

Ok, From the number of !message( statements I assume the gpf is not
occurring until the actual return() statement. I also assume that the gpf
is occurring regardless of weather BumID is 0 or <>0 (i.e. both lookup
blocks). But I still think that there is something else going on. Please
test the following:

1. If change all of the Level:Benign references to Level:Notify do you
still GPF?

2. Change the return value in the prototype from Long to Byte (and the
declaration of LOC:ReturnValue to match)

3. If BumID is 0, move ScrVar into a local string so the ParseScrVarIn
routine isn't working against the variable passed by reference.

-Mike


Johan van Zyl - JVZ Systems CC

unread,
Jul 26, 2001, 12:14:54 PM7/26/01
to
Thanks for your responses - see my comments in between.

On Thu, 26 Jul 2001 10:15:17 -0400, "Michael Ware" <war...@tabinc.com>
wrote:

>Johan,


>
>Ok, From the number of !message( statements I assume the gpf is not
>occurring until the actual return() statement. I also assume that the gpf
>is occurring regardless of weather BumID is 0 or <>0 (i.e. both lookup
>blocks).

It does not iccur when I pass a BumID that does not exist in BUM File
or when BUMId=0 an dthe ScrVar does not exist in the BUM File i.e.
when it returns level:notify it does not give an error.
It only gives an error when BUMID <>0 but contains a value that exists
in BUM File AND also when BUMID =0 and ScrVar contains a value that
exists in BUM file i.e. when level:benign (or LOC:ReturnValue=0) it
giv ethe error.


> But I still think that there is something else going on. Please
>test the following:
>
> 1. If change all of the Level:Benign references to Level:Notify do you
>still GPF?

NO


>
> 2. Change the return value in the prototype from Long to Byte (and the
>declaration of LOC:ReturnValue to match)

Did that - still Illegal Operation


> 3. If BumID is 0, move ScrVar into a local string so the ParseScrVarIn
>routine isn't working against the variable passed by reference.

Here is what the routine does - do you think it can have an influence?
ParseScrVarIn ROUTINE
!message('ParseScrVarIn ROUTINE')
If sub(ScrVar,len(clip(ScrVar)),1)<>'/'
ScrVar=Clip(ScrVar)&'/'
end
Clear(LOC:FL[])
LOC:Count=0
LOC:SS=1
loop i#=1 to len(clip(ScrVar))
If Sub(ScrVar,i#,1)='/'
LOC:Count+=1
LOC:FL[LOC:Count]=ScrVar[LOC:SS : i#-1]
LOC:SS=i#+1
LOC:Fl[LOC:count]=left(LOC:Fl[LOC:count])
end
end
!Message(ScrVar&' In Routine')
BUM:Level1=LOC:FL[1]
BUM:Level2=LOC:FL[2]
BUM:Level3=LOC:FL[3]
BUM:Level4=LOC:FL[4]
BUM:Level5=LOC:FL[5]
BUM:Level6=LOC:FL[6]
BUM:Level7=LOC:FL[7]
BUM:Level8=LOC:FL[8]
BUM:Level9=LOC:FL[9]
BUM:Level10=LOC:FL[10]


>-Mike

Arnor Baldvinsson

unread,
Jul 26, 2001, 1:25:26 PM7/26/01
to
Hi Johan,

On Wed, 25 Jul 2001 13:14:02 GMT, jo...@jvz.co.za (Johan van Zyl - JVZ
Systems CC) wrote:

>Prototype
>(string,*string,*long,<long>,string),Long
>Parameters
>(TRAType,*ScrVar,*BUMId,UserID,Lookup)

Try to change this to:

Prototype: (String TRAType, *String ScrVar, *Long BUMId, <Long
UserID>, String Lookup),LONG

Parameters: (String TRAType, *String ScrVar, *Long BUMId, <Long
UserID>, String Lookup) !!,LONG

I think it may be having problems with the parameter list.

Best regards,


Arnór Baldvinsson
San Antonio, Texas, USA
www.icetips.com & www.candobidding.com
ar...@icetips.com
ICQ: 113314380

Michael Ware

unread,
Jul 26, 2001, 2:46:06 PM7/26/01
to
Johan,
I was initialy thinking that the error was the result of manipulating the
variables that are being passed by reference, and that it wasn't the return
value of 0 itself, but a block of code that ran when you were going to be
returning 0. But since the same code can run and not gpf if you don't
return 0 I am obveously wrong.
My next step if I were you, would be to strip back the function to the
following:

If BUMId<>0
BUM:BUMID=BUMId
if Access:BUM.Fetch(BUM:Key:BUMID_PK)!<> LEVEL:Benign

LOC:ReturnValue=level:notify
return(LOC:ReturnValue)
else

LOC:ReturnValue=Level:Benign
Return(LOC:ReturnValue)
end
end

If clip(ScrVar)<>''


LOC:ReturnValue=Level:Benign
Return(LOC:ReturnValue)

else


LOC:ReturnValue=level:notify
return(LOC:ReturnValue)

end

If this doesn't run, at least you have a clean example to post to the Bugs
news group. If this does run start adding code back in until it breaks
again.

As a last thought you may want to try removing the () from the returns
(ie "Return LOC:ReturnValue" instead of "Return(LOC:ReturnValue)" )

Good Luck
-Mike

Johan van Zyl - JVZ Systems CC <jo...@jvz.co.za> wrote in message
news:3b603fa2...@news.softvelocity.com...

Maarten

unread,
Jul 26, 2001, 3:00:17 PM7/26/01
to
Arnor,

> Prototype: (String TRAType, *String ScrVar, *Long BUMId, <Long
> UserID>, String Lookup),LONG

I like to use the second form of ommitable parameters:
instead of <Long UserID> you type: Long UserID=0
Now you don't have to use Omitted(4) to test if the
parameter is passed (which can be a pain in ABC)
but directly code: IF UserID .......
since it's always initialised, passed or not.


--

Best regards,
Maarten
CDD3.1, C5EEb - ABC & C5.5.04EE
Certainly Clarion Developer


Johan van Zyl - JVZ Systems CC

unread,
Jul 26, 2001, 5:36:16 PM7/26/01
to
Hi All
Thanks for your responses - I have just been installing Win 2000 for
the first time, then I downloaded the NG messages, but it is getting
to midnight, now I am going to bed, will test all of this tomorow.
Thanks again
JVZ

On Wed, 25 Jul 2001 11:47:56 +0200, "Johan van Zyl" <jo...@jvz.co.za>
wrote:

Johan van Zyl - Somerset West - South Africa

Arnor Baldvinsson

unread,
Jul 26, 2001, 7:14:48 PM7/26/01
to
Hi Maarten,

On Thu, 26 Jul 2001 21:00:17 +0200, "Maarten" <maar...@planet.nl>
wrote:

>I like to use the second form of ommitable parameters:
>instead of <Long UserID> you type: Long UserID=0
>Now you don't have to use Omitted(4) to test if the
>parameter is passed (which can be a pain in ABC)
>but directly code: IF UserID .......
>since it's always initialised, passed or not.

Good point! I rarely use omittable parameters (it has just worked out
that way for me, used them a few times, but it's rare) so I tend to
forget. As a sidenote you can use this in API prototyping to set
default values for parameters you need, but almost always pass a
certain value to.

Jim Kane

unread,
Jul 26, 2001, 9:10:05 PM7/26/01
to
In article <3b5fa77b...@news.softvelocity.com>, Johan van Zyl -
JVZ Systems CC wrote:
> ScrVar=ScrVar[1 : (len(clip(ScrVar))-1)]
>
bad indexes on string slicing causes gpf. I'd verify
len(clip(scrvar))>2 before calling that.
0 new messages