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 >
Text File  |  2000-01-12  |  1KB  |  33 lines

  1.     ; Cache object script sample
  2.  
  3.         set oref=##class(Dog).%OpenId(id)
  4.         do Person.Dogs.Insert(oref)
  5.         do oref.%Close()
  6.         set sc=$g(sc)+1,sc(sc)=" do "_ref_"."_attr_".Clear()"
  7.         set sc=sc+1,sc(sc)=" new id,oref set id="""""
  8.         set sc=sc+1,sc(sc)=" for  set id=$order(VALUE("""_control_""",id)) quit:id=""""  do"
  9.         set sc=sc+1,sc(sc)=" . set oref=##class("_type_").%OpenId(id)"
  10.         set sc=sc+1,sc(sc)=" . do "_ref_"."_attr_".Insert(oref)"
  11.         set sc=sc+1,sc(sc)=" . do oref.%Close()"
  12.         quit
  13. ID(class,ref,attr,label,control,size,type,displayfields,hasL2D,hasD2L,button,pagename) ; ID field
  14.         new qry,qparm1
  15.         if 'size set size=40 ; unknown size, assume 40
  16.         &html<
  17.         <tr>
  18.         <td><%=label%> :</td>
  19.         <td><input type=text size=<%=size%> name=<%=control%> value=* disabled>>
  20.         ; (only) if the ID query has no parameters, put the button here
  21.         set qry=$lg(searches("ID"),4),qparm1=$lg(searches("ID"),5)
  22.         if $l(qry),qparm1'?1"txt".e &html< <input type=submit name=<%=button%> value=Search action=<%=attr%>Search nextpage="<%=wldapp%>/SearchPage">>
  23.         &html<
  24.         </td></tr>>
  25.         set controls(control)=""
  26.         ; lc is the code to run during LoadPerson
  27.         ;set txtId=Person.%Id()
  28.         set lc=$g(lc)+1,lc(lc)=" set "_control_"=id"
  29.         quit
  30. DOWRITE    ;
  31.     &sql( SELECT * FROM Person ORDER BY :Name )
  32.     q
  33.