home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 December
/
PCWorld_2000-12_cd.bin
/
Software
/
Topware
/
scrworx
/
_SETUP.1
/
mac.slf
< prev
next >
Wrap
Text File
|
2000-01-12
|
1KB
|
33 lines
; Cache object script sample
set oref=##class(Dog).%OpenId(id)
do Person.Dogs.Insert(oref)
do oref.%Close()
set sc=$g(sc)+1,sc(sc)=" do "_ref_"."_attr_".Clear()"
set sc=sc+1,sc(sc)=" new id,oref set id="""""
set sc=sc+1,sc(sc)=" for set id=$order(VALUE("""_control_""",id)) quit:id="""" do"
set sc=sc+1,sc(sc)=" . set oref=##class("_type_").%OpenId(id)"
set sc=sc+1,sc(sc)=" . do "_ref_"."_attr_".Insert(oref)"
set sc=sc+1,sc(sc)=" . do oref.%Close()"
quit
ID(class,ref,attr,label,control,size,type,displayfields,hasL2D,hasD2L,button,pagename) ; ID field
new qry,qparm1
if 'size set size=40 ; unknown size, assume 40
&html<
<tr>
<td><%=label%> :</td>
<td><input type=text size=<%=size%> name=<%=control%> value=* disabled>>
; (only) if the ID query has no parameters, put the button here
set qry=$lg(searches("ID"),4),qparm1=$lg(searches("ID"),5)
if $l(qry),qparm1'?1"txt".e &html< <input type=submit name=<%=button%> value=Search action=<%=attr%>Search nextpage="<%=wldapp%>/SearchPage">>
&html<
</td></tr>>
set controls(control)=""
; lc is the code to run during LoadPerson
;set txtId=Person.%Id()
set lc=$g(lc)+1,lc(lc)=" set "_control_"=id"
quit
DOWRITE ;
&sql( SELECT * FROM Person ORDER BY :Name )
q