Commit 3d8a4d38 authored by Peter Achten's avatar Peter Achten

<<? and <<! added: are reversed versions of ?>> and !>>


git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@71 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 092dd3de
......@@ -85,6 +85,8 @@ return_V :: !a -> Task a | iCreateAndPrint a
/* prompting variants
(?>>) :: prompt as long as task is active but not finished
(!>>) :: prompt when task is activated
(<<?) :: same as ?>>, except that prompt is displayed *after* task
(<<!) :: same as !>>, except that prompt is displayed *after* task
(<|) :: repeat task (recursively) as long as predicate does not hold, and give error message otherwise
(<!) :: repeat task (as a loop) as long as predicate does not hold; also works for tasks that don't require any user interactions (e.g. database access)
return_VF :: return the value and show the Html code specified
......@@ -93,9 +95,11 @@ return_D :: return the value and show it in iData display format
(?>>) infix 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(!>>) infix 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(<<?) infix 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<<!) infix 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<|) infix 6 :: !(Task a) !(a -> (Bool, [BodyTag])) -> Task a | iCreate a
(<!) infix 6 :: !(Task a) !(a -> .Bool) -> Task a | iCreateAndPrint a
return_VF :: !a ![BodyTag] -> Task a | iCreateAndPrint a
return_VF :: ![BodyTag] !a -> Task a | iCreateAndPrint a
return_D :: !a -> Task a | gForm {|*|}, iCreateAndPrint a
/* Assign tasks to user with indicated id
......
......@@ -526,8 +526,8 @@ where
return_Display` tst
= (a,{tst & html = tst.html +|+ BT [toHtml a ]}) // return result task
return_VF :: !a ![BodyTag] -> (Task a) | iCreateAndPrint a
return_VF a bodytag = mkTask "return_VF" return_VF`
return_VF :: ![BodyTag] !a -> (Task a) | iCreateAndPrint a
return_VF bodytag a = mkTask "return_VF" return_VF`
where
return_VF` tst
= (a,{tst & html = tst.html +|+ BT bodytag})
......@@ -561,6 +561,24 @@ where
# (a,tst=:{html=nhtml}) = task {tst & html = BT []}
= (a,{tst & html = ohtml +|+ BT prompt +|+ nhtml})
(<<?) infix 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<<?) task prompt = doTask
where
doTask tst=:{html=ohtml,activated}
| not activated = (createDefault,tst)
// # (a,tst=:{activated,html=nhtml}) = IF_Ajax (UseAjax @>> task) task {tst & html = BT []}
# (a,tst=:{activated,html=nhtml}) = task {tst & html = BT []}
| activated = (a,{tst & html = ohtml})
= (a,{tst & html = ohtml +|+ nhtml +|+ BT prompt})
(<<!) infix 5 :: !(Task a) ![BodyTag] -> (Task a) | iCreate a
(<<!) task prompt = doTask
where
doTask tst=:{html=ohtml,activated=myturn}
| not myturn = (createDefault,tst)
# (a,tst=:{html=nhtml}) = task {tst & html = BT []}
= (a,{tst & html = ohtml +|+ nhtml +|+ BT prompt})
/////////////////////////////////////
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment