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
-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...
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
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
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
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
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
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...
> 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
On Wed, 25 Jul 2001 11:47:56 +0200, "Johan van Zyl" <jo...@jvz.co.za>
wrote:
Johan van Zyl - Somerset West - South Africa
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.