Tintware Documentation : Tint Automation Client : ADO Example : ADO Example Source To run this code, you will have to copy it into a file and load the file in Tint Emacs. Use M-x eval-current-buffer to compile the code. Def:Proc:ado(%cs,%node) [*] #(def?,oleauto.new-object,,( #(tint.ignore,#(tint.library,toac)) )) #(ado.connection,#(oleauto.new-object,adodb.connection),(%cs), #(oleauto.new-object,adodb.command),%node) [*] Def:Proc:ado.connection(%con,%cs,%cmd,%node) [*] #(proc,%con.OnWillConnect,(#(ado.on-will-connect,%obj,%args)),,,%obj,%args) #(proc,%con.OnWillExecute,(#(ado.on-will-execute,%obj,%args)),,,%obj,%args) #(%con.Open,(%cs),,,) #(%cmd.ActiveConnection.putref,%con) #(ado.child,%cmd,%node) #(ado.container,%cmd,adict,dict) #(ado.procedure,%cmd,aprocedure,body of the procedure) #(ado.string,%cmd,astring,this is the value,0,0) #(undef,%con) #(undef,%cmd) [*] Def:Proc:ado.on-will-connect(%obj,%args) [*] #(emacs.util.message,on-will-connect: #(tint.firstn,#(%args.1),40)...) [*] Def:Proc:ado.on-will-execute(%obj,%args) [*] #(emacs.util.message,on-will-execute: #(tint.firstn,#(%args.1),40)...) [*] Def:Proc:ado.child(%cmd,%node) [*] #(def?,ado.child.#(tint.type,%node),( #(ado.child.#(tint.type,%node),%cmd,%node) )) [*] Def:Proc:ado.body(%body) [*] #(tint.map-string,#(tint.map-string,#(tint.map-string, #(tint.firstn,%body,255),',"),( ), ),( ), ) [*] Def:Proc:ado.child.string(%cmd,%node) [*] #(ado.string,%cmd,%node,#(ado.body,#(tint.data,##(%node.get-all))), #(%node.offset),#(%node.attribute)) [*] Def:Proc:ado.child.procedure(%cmd,%node) [*] #(ado.procedure,%cmd,%node,#(ado.body,#(tint.data,##(%node,%arg1,%arg2,%arg3, %arg4,%arg5,%arg6,%arg7,%arg8,%arg9)))) #(tint.foreach,##(tint.list,( ),%node.),( ), (ado.child.item,%cmd,%node)) [*] Def:Proc:ado.child.item(%cmd,%node,%item) [*] #(ado.child,%cmd,%node.%item) [*] Def:Proc:ado.child.dict(%cmd,%node) [*] #(ado.container,%cmd,%node,dict) #(tint.foreach,##(tint.list,( ),%node.),( ), (ado.child.item,%cmd,%node)) [*] Def:Proc:ado.child.array(%cmd,%node) [*] #(ado.container,%cmd,%node,array) #(tint.foreach,##(tint.list,( ),%node.),( ), (ado.child.item,%cmd,%node)) [*] Def:Proc:ado.container(%cmd,%name,%type) [*] #(%cmd.CommandText.put, (INSERT INTO TintContainers (Name, Type) VALUES ('%name', '%type'))) #(undef,#(%cmd.Execute)) [*] Def:Proc:ado.string(%cmd,%name,%body,%offset,%attribute) [*] #(%cmd.CommandText.put, #(=,%body,,( (INSERT INTO TintStrings (Name, Body, Offset, Attribute) VALUES ('%name', '<empty>', %offset, '%attribute')) ),( (INSERT INTO TintStrings (Name, Body, Offset, Attribute) VALUES ('%name', '%body', %offset, '%attribute')) ))) #(undef,#(%cmd.Execute)) [*] Def:Proc:ado.procedure(%cmd,%name,%body) [*] #(%cmd.CommandText.put, #(=,%body,,( (INSERT INTO TintProcedures (Name, Body) VALUES ('%name', '<empty>')) ),( (INSERT INTO TintProcedures (Name, Body) VALUES ('%name', '%body')) ))) #(undef,#(%cmd.Execute)) [*] |