Subversion Repositories wimsdev

Rev

Rev 16204 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !distribute items $wims_read_parm into n_,1_,2_,3_,4_,5_
  2. !if NaN isin $[$n_] or $n_<1 or $n_>$methparmcnt
  3.   !exit
  4. !endif
  5.  
  6. !set t_=!item $n_ of $methparmtype
  7. !distribute words $t_ into t_,p_
  8. !if $t_ iswordof number parm function text choice
  9.   !goto $t_
  10. !else
  11.   !goto text
  12. !endif
  13.  
  14. :number
  15.  !default 1_=10
  16. :input
  17.  <input size="$1_" name="methparm$n_" value="$(methparm$n_)">
  18. !exit
  19.  
  20. :function
  21.  !default 1_=22
  22.  !goto input
  23.  
  24. :text
  25.  !default 1_=30
  26.  !goto input
  27.  
  28. :choice
  29.  !formselect methparm$n_ from 1 to $p_ prompt $methchoiceprompt
  30. !exit
  31.  
  32. :parm
  33.  
  34. !set N_=!linecnt $(mtobj$n_)
  35. !reset P_
  36. !if $N_>1 or ($N_=1 and $n_ isitemof $methparmrelax)
  37.   !for i=1 to $N_
  38.     !set l=!line $i of $(mtobj$n_)
  39.     !set l=!item 2 to -1 of $l
  40.     !set l=!items2words $l
  41.     !set P_=!append item $l to $P_
  42.   !next i
  43.   !set P_=!replace internal < by &lt; in $P_
  44.   !set P_=!replace internal > by &gt; in $P_
  45.   !if $n_ isitemof $methparmrelax
  46.     !set p0=$ch_optional
  47.   !else
  48.     !set p0=$ch_choose
  49.   !endif
  50.   !formselect methparm$n_ from 0 to $N_ prompt $p0,$P_
  51. !else
  52.   !if $N_=1
  53.     <input type="hidden" name="methparm$n_" value="1">
  54.     !set l=!item 2 to -1 of $(mtobj$n_)
  55.     !set l=!items2words $l
  56.     !insmath $l
  57.   !else
  58.     <span class="tt">$ch_optional</span>
  59.   !endif
  60. !endif
  61. !exit
  62.