Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 20 JUL 2006 12:55:56PM Richard Richter wrote:

I've been looking at this error for 2 days and can't figure it out. Maybe someone can help. I have the following Option Event on a DBTable:

Declare Function Get_Property,Repository,IndexLookup

Declare Subroutine Set_Property

Pos=Get_Property(CtrlEntID,"SELPOS")

Col=Field(Pos,@FM,1)

Row=Field(Pos,@FM,2)

Begin Case

Case Col=2
	EmpKey=IndexLookup(CtrlEntID1,'F.','PATIENT','FIRST_NAME_XREF':@VM:'LAST_NAME_XREF','FIRST_NAME_PI':@VM:'MI_PI':@VM:'LAST_NAME_PI':@VM:'ADDR1':@VM:'CITY':@VM:'BIRTH_PI','SINGLE','')
	If EmpKey # "" Then
		EmpName=XLate("PATIENT",EmpKey,{NAME_LAST_FIRST},"X")
		v=Set_Property(CtrlEntID,"CELLPOS",EmpKey,1:@FM:Row)
		v=Set_Property(CtrlEntID,"CELLPOS",EmpName,Pos)
		v=Set_Property(CtrlEntID,"SELPOS",3:@FM:Row)
	End
	Case Col=4
	Rel=Repository("EXECUTE","DENT*POPUP**RELATION")
	Relate=XLate("RELATION",Rel,1,"X")
	v=Set_Property(CtrlEntID,"CELLPOS",Rel,3:@FM:Row)
	v=Set_Property(CtrlEntID,"CELLPOS",Relate,Pos)
	v=Set_Property(CtrlEntID,"SELPOS",5:@FM:Row)
	Case Col=5
	Ins="
	InsKey=IndexLookup(@Window,"INSURANCE","PLAN_NAME_XREF","PLAN_NAME","SINGLE","")
	If InsKey # "" Then
		v=Set_Property(CtrlEntID,"CELLPOS",InsKey,Pos)
		v=Set_Property(CtrlEntID,"SELPOS",7:@FM:Row)
	End
	Case Col=7
	PS=Repository("EXECUTE","DENT*MESSAGE**PRIMARY_SECONDARY")
	If PS=1 Then PS= "P" Else PS=S"
	v=Set_Property(CtrlEntID,"CELLPOS",PS,Pos)
	v=Set_Property(CtrlEntID,"SELPOS",2:@FM:Row +1)
	End

End Case

RETURN 1

I get the following error message:

B202: Line 9. Unterminate Conditional Clause

Can anybody help me with this error? I'm at a loss. It's probable something very obvious. It never hurts to have another pair of eyes.

Thanks,

Richard Richter


At 20 JUL 2006 01:31PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Case Col=7 has a spurious end statement as you don't use a multiline if/then/else here.

The Sprezzatura Group

World leaders in all things RevSoft


At 20 JUL 2006 03:51PM Warren Auyong wrote:

Sharp-eyed Sprezz picked out the flaw.

You could always cut-n-paste the code into the new system editor and use the format tool to find stuff like this.

It would be nice if we could call the format tool from the script editor in form designer but I'm sure Mike & Co are working on that.


At 21 JUL 2006 09:16AM Bob Carten wrote:

It would be nice if we could call the format tool from the script editor in form designer but I'm sure Mike & Co are working on that.[/i]

Not in there yet. A function to do that, formatted with Sprezz style tags would look like:

 pre.code { background-color: #E5E5E5;
            border: 1px solid #000000;
            width: 600px;
            padding: 5px;
            font-family: courier, verdana, arial, serif;
            margin: 0px 10px auto;
          }
Subroutine format_eventscript(argCtrlEntID, argEvent, argApp) 
/*
* 07-20-06  rjc    Indent an event handler
*
*                  run format_eventscript 'MYWINDOW.MYPROMPT', 'LOSTFOCUS'
*/

 declare function format_prog
 equ cr$ to \0D\
 
 table=SYSREPOSEVENTS'
 if assigned(argApp)       then app=argApp             else app='
 if assigned(argEvent)     then Event= argEvent        else Event='
 if assigned(argCtrlEntID) then CtrlEntID=argCtrlEntID else CtrlEntID='
 
 if app else app=@appid
  
 entity=CtrlEntID
 if count(entity, '.') else entity :=.'
  
*":event:"*":entity
 unformatted=Xlate(table, id, '', 'X') 
 if unformatted else
   return
 end
 
 formatted=format_prog(event, unformatted)
 convert cr$ to @fm in formatted
 if formatted # unformatted then
    call Write_Row(table, id, formatted, 1)
 end
 
return 


HTH

Bob


At 17 NOV 2009 11:24AM S Mecklenberg wrote:

case col=7 - yep, extra "end" statement.

as well, Set_Property is called as a function but declared as a subroutine.

Regards, Stacy

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/03ce14a530e7ca21852571b1005d030d.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1