Index: doc/howto.txt ================================================================== --- doc/howto.txt +++ doc/howto.txt @@ -16,10 +16,11 @@ http://the.domain.com/pagename/p1/p2/p3?param1=value1 (s:get-page-params) => '("p1" "p2") (s:get-param 'param1) => "value1" +(s:get-param 'param1 'number) => number or #f Create a link. ~~~~~~~~~~~~~~ (s:null "[" (s:a name 'href @@ -68,10 +69,11 @@ Get and set a session var ~~~~~~~~~~~~~~~~~~~~~~~~~ (s:session-var-get "keyname") +(s:session-var-get "keyname" 'number) (s:session-var-set! "keyname" "value") 5.1 Page local vars (s:set! key val) @@ -81,17 +83,19 @@ make a selection drop down ~~~~~~~~~~~~~~~~~~~~~~~~~~ In view.scm: -(s:select '(("World" 0)("Country" 1)("State" 2)("Town/City" 3)) 'name 'scope) +(s:select '(("World" 0)("Country" 1)("State" 2 #t)("Town/City" 3)) 'name 'scope) In control.scm: -(let ((scope (s:get-input 'scope))) +(let ((scope (s:get-input 'scope)) + (scope-num (s:get-input 'scope 'number))) ;; 'number, 'raw or 'escaped .... +The optional third entry sets that item as selected if true Simple error reporting ~~~~~~~~~~~~~~~~~~~~~~ In control.scm: Index: session.scm ================================================================== --- session.scm +++ session.scm @@ -435,13 +435,14 @@ (define (session:page-get self key) (hash-table-ref/default (sdat-get-pagevars self) key #f)) ;; get session vars for a specified page ;; -(define (session:get self page key) - (let ((ht (session:get-page-hash self page))) - (hash-table-ref/default ht (s:any->string key) #f))) +(define (session:get self page key params) + (let* ((ht (session:get-page-hash self page)) + (res (hash-table-ref/default ht (s:any->string key) #f))) + (session:apply-type-preference res params))) ;; delete a session var for a specified page ;; (define (session:del! self page key) (let ((ht (session:get-page-hash self page))) Index: setup.scm ================================================================== --- setup.scm +++ setup.scm @@ -66,12 +66,12 @@ (let ((val (session:page-get s:session key))) (session:del! s:session key) val)) ;; these are session wide -(define (s:session-var-get key) - (session:get s:session "*sessionvars*" key)) +(define (s:session-var-get key . params) + (session:get s:session "*sessionvars*" key params)) (define (s:session-var-set! key val) (session:set! s:session "*sessionvars*" key val)) (define (s:session-var-get-n-del! key)