home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 January (DVD) / VPR980100.ISO / OLS / WIN16 / TENTORI / TENTORI.LZH / TENT_S.LZH / TENTORI.FRM next >
Text File  |  1995-02-12  |  6KB  |  218 lines

  1. VERSION 2.00
  2. Begin Form formTentori 
  3.    BorderStyle     =   0  'なし
  4.    Caption         =   "点取り占い様"
  5.    Height          =   2595
  6.    Icon            =   TENTORI.FRX:0000
  7.    Left            =   2010
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2190
  10.    ScaleWidth      =   5310
  11.    Top             =   2265
  12.    Width           =   5430
  13.    Begin TextBox textTen 
  14.       BorderStyle     =   0  'なし
  15.       Enabled         =   0   'False
  16.       FontBold        =   -1  'True
  17.       FontItalic      =   0   'False
  18.       FontName        =   "MS ゴシック"
  19.       FontSize        =   14.25
  20.       FontStrikethru  =   0   'False
  21.       FontUnderline   =   0   'False
  22.       Height          =   375
  23.       Left            =   360
  24.       MousePointer    =   1  '矢印
  25.       MultiLine       =   -1  'True
  26.       TabIndex        =   4
  27.       TabStop         =   0   'False
  28.       Top             =   840
  29.       Width           =   735
  30.    End
  31.    Begin TextBox textUranai 
  32.       BorderStyle     =   0  'なし
  33.       Enabled         =   0   'False
  34.       FontBold        =   -1  'True
  35.       FontItalic      =   0   'False
  36.       FontName        =   "MS ゴシック"
  37.       FontSize        =   14.25
  38.       FontStrikethru  =   0   'False
  39.       FontUnderline   =   0   'False
  40.       Height          =   1815
  41.       Index           =   3
  42.       Left            =   1560
  43.       MousePointer    =   1  '矢印
  44.       MultiLine       =   -1  'True
  45.       TabIndex        =   3
  46.       TabStop         =   0   'False
  47.       Top             =   240
  48.       Width           =   375
  49.    End
  50.    Begin TextBox textUranai 
  51.       BorderStyle     =   0  'なし
  52.       Enabled         =   0   'False
  53.       FontBold        =   -1  'True
  54.       FontItalic      =   0   'False
  55.       FontName        =   "MS ゴシック"
  56.       FontSize        =   14.25
  57.       FontStrikethru  =   0   'False
  58.       FontUnderline   =   0   'False
  59.       Height          =   1815
  60.       Index           =   2
  61.       Left            =   2520
  62.       MousePointer    =   1  '矢印
  63.       MultiLine       =   -1  'True
  64.       TabIndex        =   2
  65.       TabStop         =   0   'False
  66.       Top             =   240
  67.       Width           =   375
  68.    End
  69.    Begin TextBox textUranai 
  70.       BorderStyle     =   0  'なし
  71.       Enabled         =   0   'False
  72.       FontBold        =   -1  'True
  73.       FontItalic      =   0   'False
  74.       FontName        =   "標準ゴシック"
  75.       FontSize        =   14.25
  76.       FontStrikethru  =   0   'False
  77.       FontUnderline   =   0   'False
  78.       Height          =   1815
  79.       Index           =   1
  80.       Left            =   3480
  81.       MousePointer    =   1  '矢印
  82.       MultiLine       =   -1  'True
  83.       TabIndex        =   1
  84.       TabStop         =   0   'False
  85.       Top             =   240
  86.       Width           =   375
  87.    End
  88.    Begin TextBox textUranai 
  89.       BorderStyle     =   0  'なし
  90.       Enabled         =   0   'False
  91.       FontBold        =   -1  'True
  92.       FontItalic      =   0   'False
  93.       FontName        =   "MS ゴシック"
  94.       FontSize        =   14.25
  95.       FontStrikethru  =   0   'False
  96.       FontUnderline   =   0   'False
  97.       Height          =   1815
  98.       Index           =   0
  99.       Left            =   4440
  100.       MousePointer    =   1  '矢印
  101.       MultiLine       =   -1  'True
  102.       TabIndex        =   0
  103.       TabStop         =   0   'False
  104.       Top             =   240
  105.       Width           =   375
  106.    End
  107.    Begin Shape shapeCircle 
  108.       BorderWidth     =   2
  109.       Height          =   495
  110.       Left            =   480
  111.       Shape           =   3  '円
  112.       Top             =   1440
  113.       Width           =   495
  114.    End
  115.    Begin Shape shapeWaku 
  116.       BorderColor     =   &H00000000&
  117.       BorderWidth     =   3
  118.       Height          =   2175
  119.       Left            =   0
  120.       Top             =   0
  121.       Width           =   5295
  122.    End
  123. End
  124.  
  125. Sub Form_KeyPress (KeyAscii As Integer)
  126.     End
  127. End Sub
  128.  
  129. Sub Form_Load ()
  130.     Dim iFileLength As Integer      ' ファイルの大きさ
  131.     Dim lpszUranai  As String       ' 占いメッセージ
  132.     Dim iTextPos    As Integer      ' 文字位置
  133.     Dim lColor      As Long         ' 表示色
  134.     Dim i           As Integer      ' 有象無象
  135.  
  136.     ' データファイルのopen
  137.     Open App.Path & "\tentori.dat" For Input As #1
  138.     iFileLength = LOF(1) - 3            ' EOFとCr,Lfの分は削っておこうかな
  139.     If iFileLength > 32000 Then
  140.         MsgBox "tentori.datが大きすぎます!", 16, "点取り占い様からの伝言"
  141.         Close #1
  142.         End
  143.     End If
  144.  
  145.     ' 占い文の選択
  146.     Randomize
  147.     Seek #1, Int(iFileLength * Rnd + 1)
  148.     Line Input #1, lpszUranai
  149.     If EOF(1) Then
  150.         Seek #1, 1
  151.     End If
  152.     Line Input #1, lpszUranai
  153.     
  154.     ' クローズだ
  155.     Close #1
  156.  
  157.     ' 表示位置の設定
  158.     formTentori.Width = 5295
  159.     formTentori.Height = 2175
  160.     formTentori.Left = (Screen.Width - formTentori.Width) / 2
  161.     formTentori.Top = (Screen.Height - formTentori.Height) / 2
  162.  
  163.  
  164.     ' とりあえずフォームを見せておくよ
  165.     Show
  166.  
  167.     ' 占い文の縦書き化(と言っても今のところ横棒のみ対応)
  168.     iTextPos = InStr(lpszUranai, "ー")
  169.     While iTextPos <> 0
  170.         Mid$(lpszUranai, iTextPos) = "|"
  171.         iTextPos = InStr(lpszUranai, "ー")
  172.     Wend
  173.  
  174.     ' 表示色の選択
  175.     lColor = RGB(&HFF * Int(Rnd * 2#), &HFF * Int(Rnd * 2#), &HFF * Int(Rnd * 2#))
  176.  
  177.     If lColor = &HFFFFFF Then
  178.         lColor = 0
  179.     End If
  180.     For i = 0 To 3
  181.         textUranai(i).ForeColor = lColor
  182.     Next
  183.     textTen.ForeColor = lColor
  184.     shapeWaku.BorderColor = lColor
  185.     shapeCircle.BorderColor = lColor
  186.     shapeCircle.FillColor = lColor
  187.  
  188.     ' 占い文の表示
  189.     If LenB(lpszUranai) <= 36 Then
  190.         iTextPos = 1
  191.     Else
  192.         iTextPos = 0
  193.     End If
  194.     
  195.     For i = iTextPos To 3
  196.         textUranai(i).Text = MidB$(lpszUranai, 1 + (i - iTextPos) * 12, 12)
  197.     Next
  198.     
  199.     ' 点数の表示
  200.     textTen.Text = Str$(Int(Rnd * 10#)) & "点"
  201.  
  202.     '占い円(?)の表示
  203.     shapeCircle.FillStyle = Int(Rnd * 7#)
  204.  
  205. End Sub
  206.  
  207. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  208.     Static f As Integer
  209.     
  210.     ' や~、ようするにあっさりした終わり方をしたかったわけです
  211.     If f < 4 Then
  212.         f = f + 1
  213.     Else
  214.         End
  215.     End If
  216. End Sub
  217.  
  218.