Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 11-12 of 12 total

Using Scheme in ASP

;The following example is in VBScript. Any scripting language that uses com objects will be similar
;1 Install PLT Scheme - it will register the dlls
;2 Control Panel > Administrative Tools > Component Services
; My Computer > DCOM Config > MzCOM
; Properties > Security > Launch and Activation Permissions > Customize
; Add Everyone or IUSR_<Computername> Allow Local Launch, Local Activation

;Output
;(define test (lambda () (+ 1 2 3 4 5)))
;15
strScheme = "(define test (lambda () (+ 1 2 3 4 5)))" 'Test Function
    
Set objScheme = Server.CreateObject("MzCOM.MzObj")   
result = objScheme.Eval(strScheme) 
result = objScheme.Eval("(test)")  'It remembers the function
Set objScheme = Nothing

Response.Write(strScheme & "<br>" & result & "<br>") 'Display Results

VBScript Error Trapping

<%
On Error Resume Next

If err.Number <> 0 Then
  Response.Write "Number = " & err.Number & "<p>"
  Response.Write "Description = " & err.Description & "<p>"
  Response.Write "Source = " & err.Source
  err.Clear
End If
%>
« Newer Snippets
Older Snippets »
Showing 11-12 of 12 total