标题:急!毕业论文VFP程序修改,谢谢!
只看楼主
cl3711
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-5-9
 问题点数:0 回复次数:1 
急!毕业论文VFP程序修改,谢谢!
public a,b,c,d,e,i,j,zks,bh,m,n,n1,n2,n3,n4   &&m为节次,n为星期
n1=1
n2=1
n3=1
n4=1
close all
use 基本参数表
a=高一班数
b=高二文科班数
c=高二理科班数
d=高三文科班数
e=高三理科班数
public i
for i=1 to a
    close all
    use 班级课表
    go top
    loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="语文"
       if found()
          y=allt(优先级)
          z=周课时
          bh=recno()
                  do case
                     case z>5
                          for j=1 to z
                              m=int(6*rand()+1)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                          endfor
                      case z=5
                           for j=1 to 5
                              m=int(4*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                          endfor
                       case z=4
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                                     n4=int(5*rand()+1)
                             for j=1 to 4
                                 m=int(4*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                             endfor
                        case z=3
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                             for j=1 to 3
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                             endfor
                         case z=2
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                             for j=1 to 2
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                             endfor
                         case z=1
                                 m=int(5*rand()+1)
                                 n=int(5*rand()+1)
                                 go bh
                                 repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
          endcase
      endif
      
      loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="数学"
       if found()
          y=allt(优先级)
          z=周课时
          bh=recno()
                  do case
                     case z>5
                          for j=1 to z
                              m=int(4*rand()+1)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                          endfor
                      case z=5
                           for j=1 to 5
                              m=int(4*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                          endfor
                       case z=4
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                                     n4=int(5*rand()+1)
                             for j=1 to 4
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                             endfor
                        case z=3
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                             for j=1 to 3
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                             endfor
                         case z=2
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                             for j=1 to 2
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                             endfor
                         case z=1
                                 m=int(5*rand()+1)
                                 n=int(5*rand()+1)
                                 go bh
                                 repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
          endcase
      endif
      
       loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="英语"
       if found()
          y=allt(优先级)
          z=周课时
          bh=recno()
                  do case
                     case z>5
                          for j=1 to z
                              m=int(4*rand()+1)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                          endfor
                      case z=5
                           for j=1 to 5
                              m=int(4*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                          endfor
                       case z=4
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                                     n4=int(5*rand()+1)
                             for j=1 to 4
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                             endfor
                        case z=3
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                             for j=1 to 3
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                             endfor
                         case z=2
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                             for j=1 to 2
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                             endfor
                         case z=1
                                 m=int(5*rand()+1)
                                 n=int(5*rand()+1)
                                 go bh
                                 repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
          endcase
      endif
      
       loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="物理"
       if found()
          y=allt(优先级)
          z=周课时
          bh=recno()
          do case
             case y="高"
                  do case
                     case z>5
                          for j=1 to z
                              m=int(7*rand()+1)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                          endfor
                      case z=5
                           for j=1 to 5
                              m=int(6*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                          endfor
                       case z=4
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                                     n4=int(5*rand()+1)
                             for j=1 to 4
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                             endfor
                        case z=3
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                             for j=1 to 3
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                             endfor
                         case z=2
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                             for j=1 to 2
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                             endfor
                         case z=1
                                 m=int(5*rand()+1)
                                 n=int(5*rand()+1)
                                 go bh
                                 repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
                  endcase
             case y="中"
                  do case
                     case z>5
                          for j=1 to z
                              m=int(4*rand()+4)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                           endfor
                     case z=5
                          for j=1 to 5
                              m=int(4*rand()+4)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                              endfor
                     case z=4
                                   n1=int(5*rand()+1)
                                   n2=int(5*rand()+1)
                                   n3=int(5*rand()+1)
                                   n4=int(5*rand()+1)
                          for j=1 to 4
                              m=int(4*rand()+4)
                              go bh+j-1
                              do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                          endfor
                     case z=3
                                   n1=int(5*rand()+1)
                                   n2=int(5*rand()+1)
                                   n3=int(5*rand()+1)
                           for j=1 to 3
                                m=int(4*rand()+4)
                                go bh+j-1
                                do case
                                   case j=1
                                        repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                   case j=2
                                        repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                   case j=3
                                        repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                 endcase
                           endfor
                     case z=2
                                 n1=int(5*rand()+1)
                                 n2=int(5*rand()+1)
                          for j=1 to 2
                             m=int(4*rand()+4)
                             go bh+j-1
                             do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                                 endfor
                      case z=1
                             m=int(4*rand()+4)
                             n=int(5*rand()+1)
                             go bh
                             repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
            endcase
          endcase
      endif
      
      loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="化学"
       if found()
          y=allt(优先级)
          z=周课时
          bh=recno()
          do case
             case y="高"
                  do case
                     case z>5
                          for j=1 to z
                              m=int(7*rand()+1)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                          endfor
                      case z=5
                           for j=1 to 5
                              m=int(6*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                          endfor
                       case z=4
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                                     n4=int(5*rand()+1)
                             for j=1 to 4
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                             endfor
                        case z=3
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                             for j=1 to 3
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                             endfor
                         case z=2
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                             for j=1 to 2
                                 m=int(5*rand()+1)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                             endfor
                         case z=1
                                 m=int(5*rand()+1)
                                 n=int(5*rand()+1)
                                 go bh
                                 repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
                  endcase
             case y="中"
                  do case
                     case z>5
                          for j=1 to z
                              m=int(4*rand()+4)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                           endfor
                     case z=5
                          for j=1 to 5
                              m=int(4*rand()+4)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                              endfor
                     case z=4
                                   n1=int(5*rand()+1)
                                   n2=int(5*rand()+1)
                                   n3=int(5*rand()+1)
                                   n4=int(5*rand()+1)
                          for j=1 to 4
                              m=int(4*rand()+4)
                              go bh+j-1
                              do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                          endfor
                     case z=3
                                   n1=int(5*rand()+1)
                                   n2=int(5*rand()+1)
                                   n3=int(5*rand()+1)
                           for j=1 to 3
                                m=int(4*rand()+4)
                                go bh+j-1
                                do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                           endfor
                     case z=2
                                 n1=int(5*rand()+1)
                                 n2=int(5*rand()+1)
                          for j=1 to 2
                             m=int(4*rand()+4)
                             go bh+j-1
                             do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                                 endfor
                      case z=1
                             m=int(4*rand()+4)
                             n=int(5*rand()+1)
                             go bh
                             repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
                endcase
          endcase
      endif
      
      loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="地理"
       if found()
          y=allt(优先级)
          z=周课时
          bh=recno()
          do case
             case y="中"
                  do case
                     case z>5
                          for j=1 to z
                              m=int(4*rand()+4)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                           endfor
                     case z=5
                          for j=1 to 5
                              m=int(4*rand()+4)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                              endfor
                     case z=4
                                   n1=int(5*rand()+1)
                                   n2=int(5*rand()+1)
                                   n3=int(5*rand()+1)
                                   n4=int(5*rand()+1)
                          for j=1 to 4
                              m=int(4*rand()+4)
                              go bh+j-1
                              do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                          endfor
                     case z=3
                                   n1=int(5*rand()+1)
                                   n2=int(5*rand()+1)
                                   n3=int(5*rand()+1)
                           for j=1 to 3
                                m=int(4*rand()+4)
                                go bh+j-1
                                do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                           endfor
                     case z=2
                                 n1=int(5*rand()+1)
                                 n2=int(5*rand()+1)
                          for j=1 to 2
                             m=int(4*rand()+4)
                             go bh+j-1
                             do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                                 endfor
                      case z=1
                             m=int(4*rand()+4)
                             n=int(5*rand()+1)
                             go bh
                             repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
            endcase
            case y="低"
                  do case
                     case z>5
                          for j=1 to z
                              m=int(3*rand()+5)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                          endfor
                      case z=5
                           for j=1 to 5
                              m=int(3*rand()+5)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                          endfor
                       case z=4
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                                     n4=int(5*rand()+1)
                             for j=1 to 4
                                 m=int(3*rand()+5)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                             endfor
                        case z=3
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                             for j=1 to 3
                                 m=int(3*rand()+5)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                             endfor
                         case z=2
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                             for j=1 to 2
                                 m=int(3*rand()+5)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                             endfor
                         case z=1
                                 m=int(3*rand()+5)
                                 n=int(5*rand()+1)
                                 go bh
                                 repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
                endcase
          endcase
      endif
      
      loca for 年级="高一".and.班级号="("+str(i,1,0)+")"+"班".and.课程名称="历史"
       if found()
          y=allt(优先级)
          z=周课时
          bh=recno()
          do case
             case y="中"
                  do case
                     case z>5
                          for j=1 to z
                              m=int(4*rand()+4)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                           endfor
                     case z=5
                          for j=1 to 5
                              m=int(4*rand()+4)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                              endfor
                     case z=4
                                   n1=int(5*rand()+1)
                                   n2=int(5*rand()+1)
                                   n3=int(5*rand()+1)
                                   n4=int(5*rand()+1)
                          for j=1 to 4
                              m=int(4*rand()+4)
                              go bh+j-1
                              do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                          endfor
                     case z=3
                                   n1=int(5*rand()+1)
                                   n2=int(5*rand()+1)
                                   n3=int(5*rand()+1)
                           for j=1 to 3
                                m=int(4*rand()+4)
                                go bh+j-1
                                do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                           endfor
                     case z=2
                                 n1=int(5*rand()+1)
                                 n2=int(5*rand()+1)
                          for j=1 to 2
                             m=int(4*rand()+4)
                             go bh+j-1
                             do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                                 endfor
                      case z=1
                             m=int(4*rand()+4)
                             n=int(5*rand()+1)
                             go bh
                             repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
            endcase
            case y="低"
                  do case
                     case z>5
                          for j=1 to z
                              m=int(3*rand()+5)
                              n=int(5*rand()+1)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(n)))
                          endfor
                      case z=5
                           for j=1 to 5
                              m=int(3*rand()+5)
                              go bh+j-1
                              repl 座位号 with allt(rtrim(str(m))+ltrim(str(j)))
                          endfor
                       case z=4
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                                     n4=int(5*rand()+1)
                             for j=1 to 4
                                 m=int(3*rand()+5)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                    case j=4
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n4)))
                                  endcase
                             endfor
                        case z=3
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                                     n3=int(5*rand()+1)
                             for j=1 to 3
                                 m=int(3*rand()+5)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                    case j=3
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n3)))
                                  endcase
                             endfor
                         case z=2
                                     n1=int(5*rand()+1)
                                     n2=int(5*rand()+1)
                             for j=1 to 2
                                 m=int(3*rand()+5)
                                 go bh+j-1
                                 do case
                                    case j=1
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n1)))
                                    case j=2
                                         repl 座位号 with allt(rtrim(str(m))+ltrim(str(n2)))
                                  endcase
                             endfor
                         case z=1
                                 m=int(3*rand()+5)
                                 n=int(5*rand()+1)
                                 go bh
                                 repl 座位号 with allt(rtrim(str(m))+ltrim(str(n))
                endcase
          endcase
      endif
      
      
          。。。。。。。。
use 班级课表
public bb,i,bj,njh,kcmc,skjs,zwh
bb=reccount()
for i=1 to bb
    go i
    nj=allt(年级)
    bjh=allt(班级号)
    kcmc=allt(课程名称)
    skjs=allt(授课教师)
    zwh=allt(座位号)
    gdjsm=allt(固定教室名)
    go top
    loca for (年级=allt(nj).and.班级号=allt(bjh).and.座位号=allt(zwh)).or.(授课教师=allt(skjs).and.座位号=allt(zwh)).or.(固定教室名=allt(gdjsm).and.座位号=allt(zwh))
       if found()
          do case
             case kcmc="语文".or.kcmc="数学".or.kcmc="英语"
                  m=int(4*rand()+1)
                  n=str(mod(val(zwh),10))
             case kcmc="化学".or.kcmc="物理".or.kcmc="地理".or.kcmc="生物".or.kcmc="历史".or.kcmc="政治".or.kcmc="信息".or.kcmc="体育".or.kcmc="音乐".or.kcmc="美术"
                  m=int(6*rand()+3)
                  n=str(mod(val(zwh),10))
             case kcmc="班会".or.kcmc="活动".or.kcmc="自习"
                  m=int(val(zwh)/10)
                  n=str(mod(val(zwh),10))
           endcase
          loca for (年级=allt(nj).and.班级号=allt(bjh).and.座位号=allt(rtrim(str(m))+ltrim(n))).or.(授课教师=allt(skjs).and.座位号=allt(rtrim(str(m))+ltrim(n))).or.(固定教室名=allt(gdjsm).and.座位号=allt(rtrim(str(m))+ltrim(n)))
               if found()
                  loop
                endif
         go i
         repl 座位号 with allt(rtrim(str(m))+ltrim(n))
       endif   
endfor



messagebox("自动排课已完成!", 0+64, "提示信息")
搜索更多相关主题的帖子: VFP 毕业论文 quot case 
2008-05-09 15:08
yangbai
Rank: 8Rank: 8
等 级:蝙蝠侠
帖 子:239
专家分:886
注 册:2006-9-21
得分:0 
樓主搞了这么一大堆代码上来,想要做什么?

将每一件简单的事情做到极至便是成功!
2008-05-09 18:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-213361-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.116002 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved