home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD805.psc / Source.bas < prev    next >
Encoding:
BASIC Source File  |  1999-09-09  |  67.2 KB  |  2,372 lines

  1. Attribute VB_Name = "SourceMod"
  2. 'Source! Code
  3. 'By:  InfraRed
  4. 'Comments:  I hope you like my source code, if you
  5. 'notice anything that has been copied from other
  6. 'source code, then it must have been used in one
  7. 'of my applications which I copied all of this
  8. 'from directly.  This is all in sections plus with
  9. 'comments saying what the code does in every
  10. 'sub/function, for all of you newbies who want
  11. 'to learn lots of stuff fast.  Most of you who
  12. 'will use this source code probably will want to
  13. 'use it in some program you come up with.  Will
  14. 'you please give me a little credit if you do?
  15. 'I put in a lot of easy code, plus some harder
  16. 'source code.  Enjoy.
  17. 'Contacting Me:
  18. 'E-Mail:  InfraRed@flashmail.com
  19. 'ICQ:  17948286 (UIN)
  20.  
  21. '-------------------------------------------------------
  22.  
  23. 'Sub Titles of all source code in Source.bas:
  24.  
  25. 'Section 1 (Declarations):
  26. 'Global Declarations
  27. 'Other Declarations
  28.  
  29. 'Section 2:
  30. 'FileSave
  31. 'FileOpen
  32. 'ListSave
  33. 'ListOpen
  34.  
  35. 'Section 3:
  36. 'MakeDir
  37. 'DeleteDir
  38. 'DelFilesInDir
  39.  
  40. 'Section 4:
  41. 'MoveFile
  42. 'CopyFile
  43. 'DeleteFile
  44. 'ExecuteFile
  45.  
  46. 'Section 5:
  47. 'Encrypt
  48. 'Decrypt
  49. 'BitEncrypt
  50. 'BitDecrypt
  51. 'SuperEE (Private)
  52.  
  53. 'Section 6:
  54. 'DisableCtrlAltDel
  55. 'EnableCtrlAltDel
  56. 'HideCtrlAltDel
  57. 'ShowCtrlAltDel
  58.  
  59. 'Section 7:
  60. 'OpenCD
  61. 'CloseCD
  62. 'PrintBlankPage
  63. 'PrintText
  64. 'PrintPage (Private)
  65. 'PrintNewPage (Private)
  66. 'PrintEndOfLastPage (Private)
  67.  
  68. 'Section 8:
  69. 'MakeStartupReg
  70. 'AddToStartupDir
  71. 'MakeRegFile (Private)
  72.  
  73. 'Section 9:
  74. 'Ontop
  75. 'NotOntop
  76. 'InvisibleForm
  77. 'HoleInForm
  78.  
  79. 'Section 10:
  80. 'ClipboardCopy
  81. 'ClipboardGet
  82. 'ClearClipboard
  83.  
  84. 'Section 11:
  85. 'Ping
  86. 'ConvertIPAddressToLong (Private)
  87.  
  88. 'Section 12:
  89. 'Code1
  90. 'Code2
  91. 'Decode1
  92. 'Decode2
  93. 'ReplaceC (Private)
  94.  
  95. 'Section 13:
  96. 'Add
  97. 'Subtract
  98. 'Divide
  99. 'Multiply
  100. 'ToPower
  101. 'ToRoot
  102. 'FractionToDecimal
  103. 'DecimalToPercentage
  104. 'PercentageToDecimal
  105. 'AreaOfCircle
  106. 'Circumference
  107. 'AreaOfSquare
  108. 'PerimeterOfSquare
  109. 'PerimeterOfRectangle
  110. 'AreaOfRectangle
  111. 'AreaOfTriangle
  112. 'PerimeterOfTriangle
  113. 'PerimeterOf4SidedPolygon
  114. 'VolumeOfCube
  115. 'VolumeOfPrism
  116. 'VolumeOfSphere
  117. 'VolumeOfPyramid
  118. 'VolumeOfCone
  119. 'VolumeOfCylinder
  120.  
  121. 'Section 14:
  122. 'FadeThreeColorHTML
  123. 'FadeTwoColorHTML
  124. 'FadeThreeColorYahoo
  125. 'FadeTwoColorYahoo
  126. 'FadeThreeColorANSI
  127. 'FadeTwoColorANSI
  128.  
  129. 'Section 15:
  130. 'RestartWindows
  131. 'ExitWindows
  132. 'RebootComputer
  133.  
  134. 'Section 16:
  135. 'AltCaps
  136. 'BackwardsText
  137. 'EliteType
  138. 'SpaceCharacters
  139. 'DoubleCharacters
  140. 'EchoText
  141. 'Scramble
  142. 'TwistText
  143.  
  144. 'Section 17:
  145. 'GetAppVersion
  146. 'GetAppName
  147. 'GetAppPath
  148. 'GetAppDescription
  149. 'GetAppCopyRight
  150. 'GetAppComment
  151. 'GetAppTitle
  152. 'GetAppCompanyName
  153. 'GetAppProductName
  154.  
  155. 'Section 18:
  156. 'MoveMouse
  157. 'MousePosition
  158. 'LeftClick
  159. 'LeftDown
  160. 'LeftUp
  161. 'MiddleClick
  162. 'MiddleDown
  163. 'MiddleUp
  164. 'RightClick
  165. 'RightDown
  166. 'RightUp
  167.  
  168. 'Section 19:
  169. 'DrawSquareOnForm
  170. 'DrawLineOnForm
  171. 'DrawSquareOnPictureBox
  172. 'DrawLineOnPictureBox
  173.  
  174. 'Section 20:
  175. 'ConvertRGBToHex
  176. 'RGBToHex (Private)
  177. 'ConvertHexToRGB
  178. 'HexToRGB (Private)
  179. 'WebPage
  180. 'RandomNumber
  181. 'MakeInputBox
  182. 'LengthOfString
  183. 'FindAsciiOfChr
  184. 'MakeChrFromAscii
  185. 'MakeRndChrString
  186. 'DoSendKeys
  187. 'GetTextFromListBox
  188. 'GetTextFromComboBox
  189. 'PasswordLock
  190. 'ChangeDefaultDir
  191. 'ChangeDefaultDrive
  192. 'MakeRegistrySetting
  193.  
  194.  
  195. '# Of Subs:  127
  196.  
  197. '-------------------------------------------------------
  198.  
  199. 'Section 1:  Declarations
  200.  
  201. 'Global Declarations
  202. Global MouseDown As Boolean
  203. Global MouseOver As Boolean
  204. Global Mouse As New CMouse
  205. Global s(52) As String
  206. Global pi As Long
  207. Global NumLinesOnPageToPrint As Integer
  208. Global FirstPageNum As Integer
  209. Global NextPageNum As Integer
  210. Global LineNum As Integer
  211. Global CheckThisLineNum As Integer
  212. Global NumLines As Integer
  213. Global TotalPageCount As Integer
  214.  
  215. 'Other Declarations
  216. Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  217. Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
  218. Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
  219. Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  220. Public Const MOUSEEVENTF_LEFTDOWN = &H2
  221. Public Const MOUSEEVENTF_LEFTUP = &H4
  222. Public Const MOUSEEVENTF_MIDDLEDOWN = &H20
  223. Public Const MOUSEEVENTF_MIDDLEUP = &H40
  224. Public Const MOUSEEVENTF_RIGHTDOWN = &H8
  225. Public Const MOUSEEVENTF_RIGHTUP = &H10
  226. Public Const MOUSEEVENTF_MOVE = &H1
  227. Declare Function ShowCursor& Lib "user32" (ByVal bShow As Long)
  228. Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRECT As RECT) As Long
  229. Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRECT As RECT) As Long
  230. Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
  231. Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  232. Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
  233. Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
  234. Public Const RGN_AND = 1
  235. Public Const RGN_COPY = 5
  236. Public Const RGN_DIFF = 4
  237. Public Const RGN_OR = 2
  238. Public Const RGN_XOR = 3
  239. Type POINTAPI
  240. X As Long
  241. Y As Long
  242. End Type
  243. Type RECT
  244. Left As Long
  245. Top As Long
  246. Right As Long
  247. Bottom As Long
  248. End Type
  249. Declare Function ExitWindows Lib "User" (ByVal dwReturnCode As Long, ByVal uReserved As Integer) As Integer
  250. Global Const EW_REBOOTSYSTEM = &H43
  251. Global Const EW_RESTARTWINDOWS = &H42
  252. Global Const EW_EXITWINDOWS = 0
  253. Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  254. Public Const HWND_NOTOPMOST = -2
  255. Public Const HWND_TOPMOST = -1
  256. Public Const SWP_NOMOVE = &H2
  257. Public Const SWP_NOSIZE = &H1
  258. Public Const Flags = SWP_NOMOVE Or SWP_NOSIZE
  259. Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
  260. Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
  261. Private Const SPI_SCREENSAVERRUNNING = 97
  262. Type SECURITY_ATTRIBUTES
  263. nLength As Long
  264. lpSecurityDescriptor As Long
  265. bInheritHandle As Boolean
  266. End Type
  267. Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal szData As String, ByVal cbData As Long) As Long
  268. Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  269. Declare Function RegCreateKeyEx Lib "advapi32" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long
  270. Private Const IP_STATUS_BASE = 11000
  271. Private Const IP_SUCCESS = 0
  272. Private Const IP_BUF_TOO_SMALL = (11000 + 1)
  273. Private Const IP_DEST_NET_UNREACHABLE = (11000 + 2)
  274. Private Const IP_DEST_HOST_UNREACHABLE = (11000 + 3)
  275. Private Const IP_DEST_PROT_UNREACHABLE = (11000 + 4)
  276. Private Const IP_DEST_PORT_UNREACHABLE = (11000 + 5)
  277. Private Const IP_NO_RESOURCES = (11000 + 6)
  278. Private Const IP_BAD_OPTION = (11000 + 7)
  279. Private Const IP_HW_ERROR = (11000 + 8)
  280. Private Const IP_PACKET_TOO_BIG = (11000 + 9)
  281. Private Const IP_REQ_TIMED_OUT = (11000 + 10)
  282. Private Const IP_BAD_REQ = (11000 + 11)
  283. Private Const IP_BAD_ROUTE = (11000 + 12)
  284. Private Const IP_TTL_EXPIRED_TRANSIT = (11000 + 13)
  285. Private Const IP_TTL_EXPIRED_REASSEM = (11000 + 14)
  286. Private Const IP_PARAM_PROBLEM = (11000 + 15)
  287. Private Const IP_SOURCE_QUENCH = (11000 + 16)
  288. Private Const IP_OPTION_TOO_BIG = (11000 + 17)
  289. Private Const IP_BAD_DESTINATION = (11000 + 18)
  290. Private Const IP_ADDR_DELETED = (11000 + 19)
  291. Private Const IP_SPEC_MTU_CHANGE = (11000 + 20)
  292. Private Const IP_MTU_CHANGE = (11000 + 21)
  293. Private Const IP_UNLOAD = (11000 + 22)
  294. Private Const IP_ADDR_ADDED = (11000 + 23)
  295. Private Const IP_GENERAL_FAILURE = (11000 + 50)
  296. Private Const MAX_IP_STATUS = 11000 + 50
  297. Private Const IP_PENDING = (11000 + 255)
  298. Private Type ip_option_information
  299. Ttl             As Byte
  300. Tos             As Byte
  301. Flags           As Byte
  302. OptionsSize     As Byte
  303. OptionsData     As Long
  304. End Type
  305. Private Type icmp_echo_reply
  306. Address         As Long
  307. Status          As Long
  308. RoundTripTime   As Long
  309. DataSize        As Integer
  310. Reserved        As Integer
  311. DataPointer     As Long
  312. Options         As ip_option_information
  313. Data            As String * 250
  314. End Type
  315. Private Declare Function IcmpCreateFile Lib "icmp.dll" () As Long
  316. Private Declare Function IcmpCloseHandle Lib "icmp.dll" (ByVal IcmpHandle As Long) As Long
  317. Private Declare Function IcmpSendEcho Lib "icmp.dll" (ByVal IcmpHandle As Long, _
  318.                                                     ByVal DestinationAddress As Long, _
  319.                                                     ByVal RequestData As String, _
  320.                                                     ByVal RequestSize As Integer, _
  321.                                                     RequestOptions As ip_option_information, _
  322.                                                     ReplyBuffer As icmp_echo_reply, _
  323.                                                     ByVal ReplySize As Long, _
  324.                                                     ByVal Timeout As Long) As Long
  325. Private Const PING_TIMEOUT = 200
  326. Private Const WSADESCRIPTION_LEN = 256
  327. Private Const WSASYSSTATUS_LEN = 256
  328. Private Const WSADESCRIPTION_LEN_1 = WSADESCRIPTION_LEN + 1
  329. Private Const WSASYSSTATUS_LEN_1 = WSASYSSTATUS_LEN + 1
  330. Private Const SOCKET_ERROR = -1
  331. Private Type tagWSAData
  332. wVersion            As Integer
  333. wHighVersion        As Integer
  334. szDescription       As String * WSADESCRIPTION_LEN_1
  335. szSystemStatus      As String * WSASYSSTATUS_LEN_1
  336. iMaxSockets         As Integer
  337. iMaxUdpDg           As Integer
  338. lpVendorInfo        As String * 200
  339. End Type
  340. Private Declare Function WSAStartup Lib "wsock32" (ByVal wVersionRequested As Integer, lpWSAData As tagWSAData) As Integer
  341. Private Declare Function WSACleanup Lib "wsock32" () As Integer
  342.  
  343. 'Section 2:  Saving/Opening Files
  344.  
  345. Public Sub FileSave(Text As String, FilePath As String)
  346. 'Save a text file
  347. On Error GoTo error
  348. Dim Directory As String
  349.               Directory$ = FilePath
  350.        On Error GoTo error
  351.        Open Directory$ For Output As #1
  352.            Print #1, Text
  353.        Close #1
  354. Exit Sub
  355. error:  MsgBox Err.Description, vbExclamation, "Error"
  356. End Sub
  357.  
  358. Function FileOpen(FilePath As String)
  359. 'Open a text file
  360. On Error GoTo error
  361. Dim Directory As String
  362. Directory$ = FilePath
  363.     Dim MyString As String
  364.        On Error GoTo error
  365.        Open Directory$ For Input As #1
  366.        While Not EOF(1)
  367.            Input #1, FileOpen
  368.            Wend
  369.            Close #1
  370. Exit Function
  371. error:  MsgBox Err.Description, vbExclamation, "Error"
  372. End Function
  373.  
  374. Public Sub ListSave(List As ListBox, FilePath As String)
  375. 'Save all data in a list box
  376. On Error GoTo error
  377. Dim i As Integer
  378. Dim Directory As String
  379.               Directory$ = FilePath
  380.        On Error GoTo error
  381.        Open Directory$ For Output As #1
  382.        For i = 0 To List.ListCount - 1
  383.            Print #1, List.List(i)
  384.        Next i
  385.        Close #1
  386. Exit Sub
  387. error:  MsgBox Err.Description, vbExclamation, "Error"
  388. End Sub
  389.  
  390. Public Sub ListOpen(List As ListBox, FilePath As String)
  391. 'Open saved list box data
  392. On Error GoTo error
  393. Directory$ = FilePath
  394.     Dim MyString As String
  395.        On Error GoTo error
  396.        Open Directory$ For Input As #1
  397.        While Not EOF(1)
  398.            Input #1, MyString$
  399.            DoEvents
  400.                List.AddItem MyString$
  401.            Wend
  402.            Close #1
  403. Exit Sub
  404. error:  MsgBox Err.Description, vbExclamation, "Error"
  405. End Sub
  406.  
  407. 'Section 3:  Deleting/Making Directories
  408.  
  409. Public Sub MakeDir(DirPath As String)
  410. 'Make a directory
  411. On Error GoTo error
  412. MkDir DirPath$
  413. Exit Sub
  414. error:  MsgBox Err.Description, vbExclamation, "Error"
  415. End Sub
  416.  
  417. Public Sub DeleteDir(DirPath As String)
  418. 'Delete a directory
  419. On Error GoTo error
  420. RmDir DirPath$
  421. Exit Sub
  422. error:  MsgBox Err.Description, vbExclamation, "Error"
  423. End Sub
  424.  
  425. Public Sub DelFilesInDir(DirPath As String, DelDir As Boolean)
  426. 'Delete all files in a directory and (optional) delete the directory too
  427. On Error GoTo error
  428. Kill DirPath$ & "*.*"
  429. If DelDir = True Then
  430. RmDir DirPath$
  431. End If
  432. Exit Sub
  433. error:  MsgBox Err.Description, vbExclamation, "Error"
  434. End Sub
  435.  
  436. 'Section 4:  Copying/Moving/Executing/Deleting Files
  437.  
  438. Public Sub MoveFile(StartPath As String, EndPath As String)
  439. 'Move a file
  440. On Error GoTo error
  441. FileCopy StartPath$, EndPath$
  442. Kill StartPath$
  443. Exit Sub
  444. error:  MsgBox Err.Description, vbExclamation, "Error"
  445. End Sub
  446.  
  447. Public Sub CopyFile(StartPath As String, EndPath As String)
  448. 'Copy a file
  449. On Error GoTo error
  450. FileCopy StartPath$, EndPath$
  451. Exit Sub
  452. error:  MsgBox Err.Description, vbExclamation, "Error"
  453. End Sub
  454.  
  455. Public Sub DeleteFile(FilePath As String)
  456. 'Delete a file
  457. On Error GoTo error
  458. Kill FilePath$
  459. Exit Sub
  460. error:  MsgBox Err.Description, vbExclamation, "Error"
  461. End Sub
  462.  
  463. Public Sub ExecuteFile(FilePath As String)
  464. 'Execute a file
  465. On Error GoTo error
  466. ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & (FilePath))
  467. Exit Sub
  468. error:  MsgBox Err.Description, vbExclamation, "Error"
  469. End Sub
  470.  
  471. 'Section 5:  Encryption/Decryption
  472.  
  473. Function Encrypt(Start As Integer, diff As Integer, beta As Integer, alpha As Integer, times As Integer, SuperEncrypt As Boolean, Text As String)
  474. 'Encrypt characters
  475. On Error GoTo error
  476. Dim i As Integer
  477. Dim curkey As Long
  478. Dim m As Long
  479. Dim endstr As String
  480. Dim Text2 As String
  481. Dim lesser As Double
  482. Dim larger As Double
  483. Dim SuperE As Boolean
  484. Dim a As Integer
  485. SuperE = SuperEncrypt
  486. If diff > 500 Then
  487. diff = 500
  488. ElseIf diff < 1 Then
  489. diff = 1
  490. End If
  491. If times > 100 Then
  492. times = 100
  493. ElseIf times < 1 Then
  494. times = 1
  495. End If
  496. If Start > 255 Then
  497. Start = 255
  498. ElseIf Start < 1 Then
  499. Start = 1
  500. End If
  501. If beta > 5 Then
  502. beta = 5
  503. ElseIf beta < 1 Then
  504. beta = 1
  505. End If
  506. If alpha > 5 Then
  507. alpha = 5
  508. ElseIf alpha < 1 Then
  509. alpha = 1
  510. End If
  511. curkey = Start
  512. curkey = (curkey * alpha) / beta
  513.   If SuperE = True Then
  514.     If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  515.     curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  516.     Else
  517.     curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  518.     End If
  519.   curkey = SuperEE(curkey, beta, alpha, beta)
  520.   End If
  521.   If curkey > 255 Then
  522.   curkey = 255 - (curkey / 255)
  523.   ElseIf curkey < 0 Then
  524.   curkey = 0 - (curkey / 255)
  525.   End If
  526. For a = 1 To times
  527. For i = 1 To Len(Text)
  528.     If 255 - curkey > curkey Then
  529.     larger = 255 - curkey
  530.     lesser = curkey
  531.     Else
  532.     larger = curkey
  533.     lesser = 255 - curkey
  534.     End If
  535.   If Asc(Mid$(Text, i, 1)) <= lesser Then
  536.   m = Asc(Mid$(Text, i, 1)) + (larger - 1)
  537.   endstr = endstr + Chr$(m)
  538.   Else
  539.   m = Asc(Mid$(Text, i, 1)) - lesser
  540.   endstr = endstr + Chr$(m)
  541.   End If
  542. curkey = curkey + diff
  543.   If curkey > 255 Then
  544.   curkey = curkey - 255
  545.   End If
  546. curkey = (curkey * alpha) / beta
  547.   If SuperE = True Then
  548.     If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  549.     curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  550.     Else
  551.     curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  552.     End If
  553.   curkey = SuperEE(curkey, beta, alpha, beta)
  554.   End If
  555. beta = beta + (2 * diff)
  556. alpha = alpha + diff
  557.   If beta > 5 Then
  558.   beta = 1
  559.   End If
  560.   If alpha > 5 Then
  561.   alpha = 1
  562.   End If
  563.   If curkey > 255 Then
  564.   curkey = 255 - (curkey / 255)
  565.   ElseIf curkey < 0 Then
  566.   curkey = 0 - (curkey / 255)
  567.   End If
  568.   If diff > 500 Then
  569.   diff = 1
  570.   Else
  571.   diff = diff + diff
  572.   End If
  573. Next i
  574. Text2 = ""
  575. Text2 = endstr
  576. endstr = ""
  577. Next a
  578. Encrypt = Text2
  579. Exit Function
  580. error:  MsgBox Err.Description, vbExclamation, "Error"
  581. End Function
  582.  
  583. Function Decrypt(Start As Integer, diff As Integer, beta As Integer, alpha As Integer, times As Integer, SuperEncrypt As Boolean, Text As String)
  584. 'Decrypt characters
  585. On Error GoTo error
  586. Dim i As Integer
  587. Dim curkey As Long
  588. Dim m As Long
  589. Dim endstr As String
  590. Dim Text2 As String
  591. Dim lesser As Double
  592. Dim larger As Double
  593. Dim SuperE As Boolean
  594. Dim a As Integer
  595. SuperE = SuperEncrypt
  596. If diff > 500 Then
  597. diff = 500
  598. ElseIf diff < 1 Then
  599. diff = 1
  600. End If
  601. If times > 100 Then
  602. times = 100
  603. ElseIf times < 1 Then
  604. times = 1
  605. End If
  606. If Start > 255 Then
  607. Start = 255
  608. ElseIf Start < 1 Then
  609. Start = 1
  610. End If
  611. If beta > 5 Then
  612. beta = 5
  613. ElseIf beta < 1 Then
  614. beta = 1
  615. End If
  616. If alpha > 5 Then
  617. alpha = 5
  618. ElseIf alpha < 1 Then
  619. alpha = 1
  620. End If
  621. curkey = Start
  622. curkey = (curkey * alpha) / beta
  623.   If SuperE = True Then
  624.     If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  625.     curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  626.     Else
  627.     curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  628.     End If
  629.   curkey = SuperEE(curkey, beta, alpha, beta)
  630.   End If
  631.   If curkey > 255 Then
  632.   curkey = 255 - (curkey / 255)
  633.   ElseIf curkey < 0 Then
  634.   curkey = 0 - (curkey / 255)
  635.   End If
  636. For a = 1 To times
  637. For i = 1 To Len(Text)
  638.     If 255 - curkey > curkey Then
  639.     larger = 255 - curkey
  640.     lesser = curkey
  641.     Else
  642.     larger = curkey
  643.     lesser = 255 - curkey
  644.     End If
  645.   If Asc(Mid$(Text, i, 1)) >= larger Then
  646.   m = Asc(Mid$(Text, i, 1)) - (larger - 1)
  647.   endstr = endstr + Chr$(m)
  648.   Else
  649.   m = Asc(Mid$(Text, i, 1)) + lesser
  650.   endstr = endstr + Chr$(m)
  651.   End If
  652. curkey = curkey + diff
  653.   If curkey > 255 Then
  654.   curkey = curkey - 255
  655.   End If
  656. curkey = (curkey * alpha) / beta
  657.   If SuperE = True Then
  658.     If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  659.     curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  660.     Else
  661.     curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  662.     End If
  663.   curkey = SuperEE(curkey, beta, alpha, beta)
  664.   End If
  665. beta = beta + (2 * diff)
  666. alpha = alpha + diff
  667.   If beta > 5 Then
  668.   beta = 1
  669.   End If
  670.   If alpha > 5 Then
  671.   alpha = 1
  672.   End If
  673.   If curkey > 255 Then
  674.   curkey = 255 - (curkey / 255)
  675.   ElseIf curkey < 0 Then
  676.   curkey = 0 - (curkey / 255)
  677.   End If
  678.   If diff > 500 Then
  679.   diff = 1
  680.   Else
  681.   diff = diff + diff
  682.   End If
  683. Next i
  684. Text2 = ""
  685. Text2 = endstr
  686. endstr = ""
  687. Next a
  688. Decrypt = Text2
  689. Exit Function
  690. error:  MsgBox Err.Description, vbExclamation, "Error"
  691. End Function
  692.  
  693. Function BitEncrypt(Text As String, Key As String)
  694. 'This will encrypt a string, using the ascii character code of another string (Key$)
  695. On Error GoTo error
  696. Dim CurPos As Long
  697. Dim i As Long
  698. Dim endstr As String
  699. Dim chrasc As Long
  700. CurPos = 1
  701. For i = 1 To Len(Text$)
  702. chrasc = Asc(Mid$(Text$, i, 1)) + Asc(Mid$(Key$, CurPos, 1))
  703.   If chrasc > 255 Then
  704.   chrasc = chrasc - 255
  705.   End If
  706. endstr$ = endstr$ & Chr$(chrasc)
  707.   If CurPos = Len(Key$) Then
  708.   CurPos = 1
  709.   Else
  710.   CurPos = CurPos + 1
  711.   End If
  712. Graph2 Len(Text$), (i)
  713. Next i
  714. BitEncrypt = endstr$
  715. Exit Function
  716. error:  MsgBox Err.Description, vbExclamation, "Error"
  717. End Function
  718.  
  719. Function BitDecrypt(Text As String, Key As String)
  720. 'This will decrypt a string, using the ascii character code of another string (Key$)
  721. On Error GoTo error
  722. Dim CurPos As Long
  723. Dim i As Long
  724. Dim endstr As String
  725. Dim chrasc As Long
  726. CurPos = 1
  727. For i = 1 To Len(Text$)
  728. chrasc = Asc(Mid$(Text$, i, 1)) - Asc(Mid$(Key$, CurPos, 1))
  729.   If chrasc < 1 Then
  730.   chrasc = chrasc + 255
  731.   End If
  732. endstr$ = endstr$ & Chr$(chrasc)
  733.   If CurPos = Len(Key$) Then
  734.   CurPos = 1
  735.   Else
  736.   CurPos = CurPos + 1
  737.   End If
  738. Graph2 Len(Text$), (i)
  739. Next i
  740. RndBitD = endstr$
  741. Exit Function
  742. error:  MsgBox Err.Description, vbExclamation, "Error"
  743. End Function
  744.  
  745. Private Function SuperEE(curkey As Long, beta As Integer, alpha As Integer, times As Integer)
  746. 'For encryption:  Change the current key around more
  747. On Error GoTo error
  748. curkey = (((curkey / times) - (beta + times)) * alpha) + ((beta / alpha) - times)
  749. If curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) < 1 Then
  750. curkey = (((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10)) * (0 - 1))
  751. Else
  752. curkey = ((curkey + beta) * alpha) - (((curkey - beta) + alpha) / ((beta - alpha) + 10))
  753. End If
  754. If beta - times = 0 Then
  755. curkey = ((curkey * alpha) + (beta * times))
  756. Else
  757. curkey = ((curkey * (beta - times)) + (beta - times))
  758.   If curkey < 0 Then
  759.   curkey = curkey + (alpha + beta)
  760.   ElseIf curkey = 0 Then
  761.   curkey = curkey + (alpha + times)
  762.   Else
  763.   curkey = curkey + (beta + times)
  764.   End If
  765. End If
  766. SuperEE = curkey
  767. Exit Function
  768. error:  MsgBox Err.Description, vbExclamation, "Error"
  769. End Function
  770.  
  771. 'Section 6:  Ctrl + Alt + Del Stuff
  772.  
  773. Public Sub DisableCtrlAltDel()
  774. 'Disable Ctrl + Alt + Del
  775. On Error GoTo error
  776. Dim ret As Integer
  777. Dim pOld As Boolean
  778. ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
  779. Exit Sub
  780. error:  MsgBox Err.Description, vbExclamation, "Error"
  781. End Sub
  782.  
  783. Public Sub EnableCtrlAltDel()
  784. 'Enable Ctrl + Alt + Del
  785. On Error GoTo error
  786. Dim ret As Integer
  787. Dim pOld As Boolean
  788. ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
  789. Exit Sub
  790. error:  MsgBox Err.Description, vbExclamation, "Error"
  791. End Sub
  792.  
  793. Public Sub HideCtrlAltDel()
  794. 'Hide this app from Ctrl + Alt + Del
  795. On Error GoTo error
  796. App.TaskVisible = False
  797. Exit Sub
  798. error:  MsgBox Err.Description, vbExclamation, "Error"
  799. End Sub
  800.  
  801. Public Sub ShowCtrlAltDel()
  802. 'Show this app in Ctrl + Alt + Del
  803. On Error GoTo error
  804. App.TaskVisible = True
  805. Exit Sub
  806. error:  MsgBox Err.Description, vbExclamation, "Error"
  807. End Sub
  808.  
  809. 'Section 7:  External Stuff (Printer/CD)
  810.  
  811. Public Sub OpenCD()
  812. 'Open the CD drive
  813. On Error GoTo error
  814. retvalue = mciSendString("set CDAudio door open", returnstring, 127, 0)
  815. Exit Sub
  816. error:  MsgBox Err.Description, vbExclamation, "Error"
  817. End Sub
  818.  
  819. Public Sub CloseCD()
  820. 'Close the CD drive
  821. On Error GoTo error
  822. retvalue = mciSendString("set CDAudio door closed", returnstring, 127, 0)
  823. Exit Sub
  824. error:  MsgBox Err.Description, vbExclamation, "Error"
  825. End Sub
  826.  
  827. Public Sub PrintBlankPage()
  828. 'Print a blank page out of a printer
  829. On Error GoTo error
  830. Printer.NewPage
  831. Exit Sub
  832. error:  MsgBox Err.Description, vbExclamation, "Error"
  833. End Sub
  834.  
  835. Public Sub PrintText(Text As String, MarginSize As Integer, AmountOfChrsInOneLine As Integer, JustUseDefault As Boolean)
  836. 'This will print the text out of the default printer
  837. On Error Resume Next
  838. Screen.MousePointer = 11
  839. If JustUseDefault = True Then
  840. MarginSize = 10
  841. AmountOfChrsInOneLine = 65
  842. End If
  843. NumLinesOnPageToPrint = 60
  844. If NextPageNum% > 0 Then NextPageNum% = 0
  845. NextPageNum% = FirstPageNum% + NextPageNum% + 1
  846. TotalPageCount% = 1
  847. Call PrintPage(Text$, MarginSize, AmountOfChrsInOneLine)
  848. PrintEndOfLastPage
  849. Screen.MousePointer = 0
  850. Exit Sub
  851. error:  MsgBox Err.Description, vbExclamation, "Error"
  852. End Sub
  853.  
  854. Private Sub PrintPage(TextString, Margin As Integer, Length_ChrsInlineOfText As Integer)
  855. 'For Print Text:  This will print a page of the text out of the printer
  856. On Error Resume Next
  857. Dim ChrPosition
  858. Dim AllChrsInThisLineOfText
  859. Dim PlaceInLineOfText As Integer
  860. ChrPosition = 1
  861. Printer.FontSize = 18
  862. Printer.Print Tab(MarginSize%);
  863. LineNum% = 1
  864. Do While ChrPosition < Len(TextString)
  865. AllChrsInThisLineOfText = Mid$(TextString, ChrPosition, Length_ChrsInlineOfText%)
  866. If ChrPosition + Len(AllChrsInThisLineOfText) < Len(TextString) Then
  867. For PlaceInLineOfText% = Len(AllChrsInThisLineOfText) To 1 Step -1
  868. If Mid$(AllChrsInThisLineOfText, PlaceInLineOfText%, 1) = Chr$(32) Then
  869. CheckThisLineNum% = 1
  870. PrintNewPage
  871. If InStr(1, AllChrsInThisLineOfText, Chr$(10), 1) > 0 Then
  872. CheckThisLineNum% = 1
  873. PrintNewPage
  874. PlaceInLineOfText% = InStr(1, AllChrsInThisLineOfText, Chr$(10), 1)
  875. LineNum% = LineNum% + 1
  876. End If
  877. If Mid$(TextString, ChrPosition, PlaceInLineOfText%) <> Chr$(13) + Chr$(10) Then
  878. Printer.Print Tab(MarginSize%);
  879. Printer.Print Mid$(TextString, ChrPosition, PlaceInLineOfText%)
  880. LineNum% = LineNum% + 1
  881. Else
  882. LineNum% = LineNum% - 1
  883. End If
  884. ChrPosition = ChrPosition + PlaceInLineOfText%
  885. PlaceInLineOfText% = 0
  886. End If
  887. Next
  888. Else
  889. CheckThisLineNum% = 1
  890. PrintNewPage
  891. Printer.Print Tab(Margin%);
  892. Printer.Print AllChrsInThisLineOfText
  893. ChrPosition = Len(TextString)
  894. LineNum% = LineNum% + 1
  895. End If
  896. Loop
  897. Exit Sub
  898. error:  MsgBox Err.Description, vbExclamation, "Error"
  899. End Sub
  900.  
  901. Private Sub PrintNewPage()
  902. 'For Print Text:  This will begin a new page to print the text out of the printer
  903. On Error Resume Next
  904. If LineNum% + CheckThisLineNum% >= NumLinesOnPageToPrint% Then
  905. Printer.Print ""
  906. Printer.Print Tab(MarginSize%);
  907. Printer.Print "(continued on page " + CStr(NextPageNum%) + ")"
  908. Printer.NewPage
  909. TotalPageCount% = TotalPageCount% + 1
  910. Printer.Print Tab(MarginSize%);
  911. Printer.Print "Page " + CStr(NextPageNum%)
  912. Printer.Print ""
  913. Printer.Print ""
  914. NextPageNum% = NextPageNum% + 1
  915. LineNum% = 3
  916. End If
  917. CheckThisLineNum% = 0
  918. Exit Sub
  919. error:  MsgBox Err.Description, vbExclamation, "Error"
  920. End Sub
  921.  
  922. Private Sub PrintEndOfLastPage()
  923. 'For Print Text:  This will print the end of the last page out of the printer
  924. On Error Resume Next
  925. If LineNum% + 2 > NumLinesOnPageToPrint% Then
  926. Printer.NewPage
  927. TotalPageCount% = TotalPageCount% + 1
  928. Printer.Print Tab(MarginSize%);
  929. Printer.Print "Page " + CStr(NextPageNum%)
  930. Printer.Print ""
  931. Printer.Print ""
  932. Printer.Print Tab(MarginSize%);
  933. Else
  934. Printer.Print ""
  935. Printer.Print Tab(MarginSize%);
  936. End If
  937. Printer.EndDoc
  938. Exit Sub
  939. error:  MsgBox Err.Description, vbExclamation, "Error"
  940. End Sub
  941.  
  942. 'Section 8:  Startup
  943.  
  944. Public Sub MakeStartupReg(AppTitle As String)
  945. 'Add your application to windows startup registry
  946. On Error GoTo error
  947. a = MakeRegFile(&H80000002, "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", AppTitle$, App.Path & "\" & App.EXEName & ".exe")
  948. Exit Sub
  949. error:  MsgBox Err.Description, vbExclamation, "Error"
  950. End Sub
  951.  
  952. Public Sub AddToStartupDir()
  953. 'Add your application to the windows startup folder
  954. On Error GoTo error
  955. FileCopy App.Path & "\" & App.EXEName & ".EXE", Mid$(App.Path, 1, 3) & "WINDOWS\START MENU\PROGRAMS\STARTUP\" & App.EXEName & ".EXE"
  956. Exit Sub
  957. error:  MsgBox Err.Description, vbExclamation, "Error"
  958. End Sub
  959.  
  960. Private Function MakeRegFile(ByVal hKey As Long, ByVal lpszSubKey As String, ByVal sSetValue As String, ByVal sValue As String) As Boolean
  961. 'For make startup and make registry setting:  Makes the registry setting
  962. On Error GoTo error
  963. Dim phkResult As Long
  964. Dim lResult As Long
  965. Dim SA As SECURITY_ATTRIBUTES
  966. Dim lCreate As Long
  967. RegCreateKeyEx hKey, lpszSubKey, 0, "", REG_OPTION_NON_VOLATILE, _
  968. KEY_ALL_ACCESS, SA, phkResult, lCreate
  969. lResult = RegSetValueEx(phkResult, sSetValue, 0, 1, sValue, _
  970. CLng(Len(sValue) + 1))
  971. RegCloseKey phkResult
  972. MakeRegFile = (lResult = ERROR_SUCCESS)
  973. Exit Function
  974. error:
  975. MakeRegFile = False
  976. End Function
  977.  
  978. Public Sub ExecuteNewProgram()
  979. 'This will execute the program over again, creating two working copies
  980. On Error GoTo error
  981. ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & App.Path & "\" & App.EXEName & ".EXE")
  982. Exit Sub
  983. error:  MsgBox Err.Description, vbExclamation, "Error"
  984. End Sub
  985.  
  986. 'Section 9:  Form Stuff
  987.  
  988. Public Sub Ontop(FormName As Form)
  989. 'Make a form always ontop of other windows
  990. On Error GoTo error
  991. Call SetWindowPos(FormName.hWnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, Flags)
  992. Exit Sub
  993. error:  MsgBox Err.Description, vbExclamation, "Error"
  994. End Sub
  995.  
  996. Public Sub NotOntop(FormName As Form)
  997. 'Make a form not always ontop of other windows
  998. On Error GoTo error
  999. Call SetWindowPos(FormName.hWnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, Flags)
  1000. Exit Sub
  1001. error:  MsgBox Err.Description, vbExclamation, "Error"
  1002. End Sub
  1003.  
  1004. Public Sub InvisibleForm(Frm As Form)
  1005. 'Make a form invisible
  1006. On Error GoTo error
  1007. Dim rctClient As RECT, rctFrame As RECT
  1008. Dim hClient As Long, hFrame As Long
  1009. GetWindowRect Frm.hWnd, rctFrame
  1010. GetClientRect Frm.hWnd, rctClient
  1011. Dim lpTL As POINTAPI, lpBR As POINTAPI
  1012. lpTL.X = rctFrame.Left
  1013. lpTL.Y = rctFrame.Top
  1014. lpBR.X = rctFrame.Right
  1015. lpBR.Y = rctFrame.Bottom
  1016. ScreenToClient Frm.hWnd, lpTL
  1017. ScreenToClient Frm.hWnd, lpBR
  1018. rctFrame.Left = lpTL.X
  1019. rctFrame.Top = lpTL.Y
  1020. rctFrame.Right = lpBR.X
  1021. rctFrame.Bottom = lpBR.Y
  1022. rctClient.Left = Abs(rctFrame.Left)
  1023. rctClient.Top = Abs(rctFrame.Top)
  1024. rctClient.Right = rctClient.Right + Abs(rctFrame.Left)
  1025. rctClient.Bottom = rctClient.Bottom + Abs(rctFrame.Top)
  1026. rctFrame.Right = rctFrame.Right + Abs(rctFrame.Left)
  1027. rctFrame.Bottom = rctFrame.Bottom + Abs(rctFrame.Top)
  1028. rctFrame.Top = 0
  1029. rctFrame.Left = 0
  1030. hClient = CreateRectRgn(rctClient.Left, rctClient.Top, rctClient.Right, rctClient.Bottom)
  1031. hFrame = CreateRectRgn(rctFrame.Left, rctFrame.Top, rctFrame.Right, rctFrame.Bottom)
  1032. CombineRgn hFrame, hClient, hFrame, RGN_XOR
  1033. SetWindowRgn Frm.hWnd, hFrame, True
  1034. Exit Sub
  1035. error:  MsgBox Err.Description, vbExclamation, "Error"
  1036. End Sub
  1037.  
  1038. Public Sub HoleInForm(Rectangular As Boolean, HoleWidth As Single, HoleHeight As Single, HoleLeft As Single, HoleTop As Single, Frm As Form)
  1039. 'This will put a hole in the form (you can see through the form with that hole)
  1040. On Error GoTo error
  1041. Const RGN_DIFF = 4
  1042. Dim outer_rgn As Long
  1043. Dim inner_rgn As Long
  1044. Dim combined_rgn As Long
  1045. Dim wid As Single
  1046. Dim hgt As Single
  1047. Dim border_width As Single
  1048. Dim title_height As Single
  1049. If Frm.WindowState = vbMinimized Then Exit Sub
  1050. wid = ScaleX(Frm.width, vbTwips, vbPixels)
  1051. hgt = ScaleY(Frm.height, vbTwips, vbPixels)
  1052. outer_rgn = CreateRectRgn(0, 0, wid, hgt)
  1053. border_width = (wid - ScaleWidth) / 2
  1054. title_height = hgt - border_width - ScaleHeight
  1055. If Rectangular = True Then
  1056. inner_rgn = CreateRectRgn(HoleLeft, HoleTop, HoleWidth, HoleHeight)
  1057. Else
  1058. inner_rgn = CreateEllipticRgn(HoleLeft, HoleTop, HoleWidth, HoleHeight)
  1059. End If
  1060. combined_rgn = CreateRectRgn(0, 0, 0, 0)
  1061. CombineRgn combined_rgn, outer_rgn, inner_rgn, RGN_DIFF
  1062. SetWindowRgn Frm.hWnd, combined_rgn, True
  1063. Exit Sub
  1064. error:  MsgBox Err.Description, vbExclamation, "Error"
  1065. End Sub
  1066.  
  1067. 'Section 10:  Clipboard Stuff
  1068.  
  1069. Public Sub ClipboardCopy(Text As String)
  1070. 'Copies text to the clipboard
  1071. On Error GoTo error
  1072. Clipboard.Clear
  1073. Clipboard.SetText Text$
  1074. Exit Sub
  1075. error:  MsgBox Err.Description, vbExclamation, "Error"
  1076. End Sub
  1077.  
  1078. Function ClipboardGet()
  1079. 'Gets the copied text from the clipboard
  1080. On Error GoTo error
  1081. ClipboardGet = Clipboard.GetText
  1082. Exit Sub
  1083. error:  MsgBox Err.Description, vbExclamation, "Error"
  1084. End Function
  1085.  
  1086. Public Sub ClearClipboard()
  1087. 'Clears the clipboard
  1088. On Error GoTo error
  1089. Clipboard.Clear
  1090. Exit Sub
  1091. error:  MsgBox Err.Description, vbExclamation, "Error"
  1092. End Sub
  1093.  
  1094. 'Section 11:  Ping
  1095.  
  1096. Public Sub Ping(Message As String, IPAddress As String)
  1097. 'Ping an IP Address
  1098. On Error GoTo error
  1099.     Dim hFile       As Long
  1100.     Dim lRet        As Long
  1101.     Dim lIPAddress  As Long
  1102.     Dim strMessage  As String
  1103.     Dim pOptions    As ip_option_information
  1104.     Dim pReturn     As icmp_echo_reply
  1105.     Dim iVal        As Integer
  1106.     Dim lPingRet    As Long
  1107.     Dim pWsaData    As tagWSAData
  1108.     strMessage = Message$
  1109.     iVal = WSAStartup(&H101, pWsaData)
  1110.     lIPAddress = ConvertIPAddressToLong(IPAddress$)
  1111.     hFile = IcmpCreateFile()
  1112.     pOptions.Ttl = 30
  1113.     pOptions.Tos = 12
  1114.     pWsaData.wVersion = 4
  1115.     lRet = IcmpSendEcho(hFile, _
  1116.                         lIPAddress, _
  1117.                         strMessage, _
  1118.                         Len(strMessage), _
  1119.                         pOptions, _
  1120.                         pReturn, _
  1121.                         Len(pReturn), _
  1122.                         PING_TIMEOUT)
  1123.  
  1124.     If lRet = 0 Then
  1125.     Else
  1126.         If pReturn.Status <> 0 Then
  1127.         Else
  1128.             lRet = IcmpCloseHandle(hFile)
  1129.             iVal = WSACleanup()
  1130.             Exit Sub
  1131.         End If
  1132.     End If
  1133. lRet = IcmpCloseHandle(hFile)
  1134. iVal = WSACleanup()
  1135. Exit Sub
  1136. error:  MsgBox Err.Description, vbExclamation, "Error"
  1137. End Sub
  1138.  
  1139. Private Function ConvertIPAddressToLong(strAddress As String) As Long
  1140. 'For Ping:  It changes the IP Address so it can be used to send the ping
  1141. On Error GoTo error
  1142.     Dim strTemp             As String
  1143.     Dim lAddress            As Long
  1144.     Dim iValCount           As Integer
  1145.     Dim lDotValues(1 To 4)  As String
  1146.     strTemp = strAddress
  1147.     iValCount = 0
  1148.     While InStr(strTemp, ".") > 0
  1149.         iValCount = iValCount + 1
  1150.         lDotValues(iValCount) = Mid(strTemp, 1, InStr(strTemp, ".") - 1)
  1151.         strTemp = Mid(strTemp, InStr(strTemp, ".") + 1)
  1152.         Wend
  1153.     iValCount = iValCount + 1
  1154.     lDotValues(iValCount) = strTemp
  1155.     If iValCount <> 4 Then
  1156.         ConvertIPAddressToLong = 0
  1157.         Exit Function
  1158.         End If
  1159.     lAddress = Val("&H" & Right("00" & Hex(lDotValues(4)), 2) & _
  1160.                 Right("00" & Hex(lDotValues(3)), 2) & _
  1161.                 Right("00" & Hex(lDotValues(2)), 2) & _
  1162.                 Right("00" & Hex(lDotValues(1)), 2))
  1163.     ConvertIPAddressToLong = lAddress
  1164. Exit Function
  1165. error:  MsgBox Err.Description, vbExclamation, "Error"
  1166. End Function
  1167.  
  1168. 'Section 12:  Code/Decode
  1169.  
  1170. Function Code1(Text As String)
  1171. 'This codes text into different words and phrases!  Make like a secret agent..
  1172. On Error GoTo error
  1173. Dim i As Long
  1174. Dim RndN As Integer
  1175. Dim endstr As String
  1176. Randomize Timer
  1177. Text$ = ReplaceC(Text$, "A", "a")
  1178. Text$ = ReplaceC(Text$, "B", "b")
  1179. Text$ = ReplaceC(Text$, "C", "c")
  1180. Text$ = ReplaceC(Text$, "D", "d")
  1181. Text$ = ReplaceC(Text$, "E", "e")
  1182. Text$ = ReplaceC(Text$, "F", "f")
  1183. Text$ = ReplaceC(Text$, "G", "g")
  1184. Text$ = ReplaceC(Text$, "H", "h")
  1185. Text$ = ReplaceC(Text$, "I", "i")
  1186. Text$ = ReplaceC(Text$, "J", "j")
  1187. Text$ = ReplaceC(Text$, "K", "k")
  1188. Text$ = ReplaceC(Text$, "L", "l")
  1189. Text$ = ReplaceC(Text$, "M", "m")
  1190. Text$ = ReplaceC(Text$, "N", "n")
  1191. Text$ = ReplaceC(Text$, "O", "o")
  1192. Text$ = ReplaceC(Text$, "P", "p")
  1193. Text$ = ReplaceC(Text$, "Q", "q")
  1194. Text$ = ReplaceC(Text$, "R", "r")
  1195. Text$ = ReplaceC(Text$, "S", "s")
  1196. Text$ = ReplaceC(Text$, "T", "t")
  1197. Text$ = ReplaceC(Text$, "U", "u")
  1198. Text$ = ReplaceC(Text$, "V", "v")
  1199. Text$ = ReplaceC(Text$, "W", "w")
  1200. Text$ = ReplaceC(Text$, "X", "x")
  1201. Text$ = ReplaceC(Text$, "Y", "y")
  1202. Text$ = ReplaceC(Text$, "Z", "z")
  1203. Text$ = ReplaceC(Text$, "  ", ";")
  1204. Text$ = ReplaceC(Text$, " ", ",")
  1205. For i = 1 To Len(Text$)
  1206. RndN = Int((3 - 0 + 1) * Rnd + 0)
  1207. If Mid$(Text$, i, 1) = "a" Then
  1208.   If RndN = 0 Then
  1209.   endstr$ = endstr$ + " somewhere"
  1210.   ElseIf RndN = 1 Then
  1211.   endstr$ = endstr$ + " did you"
  1212.   ElseIf RndN = 2 Then
  1213.   endstr$ = endstr$ + " flowers"
  1214.   ElseIf RndN = 3 Then
  1215.   endstr$ = endstr$ + " eat food"
  1216.   End If
  1217. ElseIf Mid$(Text$, i, 1) = "b" Then
  1218.   If RndN = 0 Then
  1219.   endstr$ = endstr$ + " light candle"
  1220.   ElseIf RndN = 1 Then
  1221.   endstr$ = endstr$ + " mirror"
  1222.   ElseIf RndN = 2 Then
  1223.   endstr$ = endstr$ + " cold soup"
  1224.   ElseIf RndN = 3 Then
  1225.   endstr$ = endstr$ + " video tape"
  1226.   End If
  1227. ElseIf Mid$(Text$, i, 1) = "c" Then
  1228.   If RndN = 0 Then
  1229.   endstr$ = endstr$ + " the murder"
  1230.   ElseIf RndN = 1 Then
  1231.   endstr$ = endstr$ + " read book"
  1232.   ElseIf RndN = 2 Then
  1233.   endstr$ = endstr$ + " the show"
  1234.   ElseIf RndN = 3 Then
  1235.   endstr$ = endstr$ + " paper"
  1236.   End If
  1237. ElseIf Mid$(Text$, i, 1) = "d" Then
  1238.   If RndN = 0 Then
  1239.   endstr$ = endstr$ + " beautiful"
  1240.   ElseIf RndN = 1 Then
  1241.   endstr$ = endstr$ + " do not"
  1242.   ElseIf RndN = 2 Then
  1243.   endstr$ = endstr$ + " bring"
  1244.   ElseIf RndN = 3 Then
  1245.   endstr$ = endstr$ + " that"
  1246.   End If
  1247. ElseIf Mid$(Text$, i, 1) = "e" Then
  1248.   If RndN = 0 Then
  1249.   endstr$ = endstr$ + " star"
  1250.   ElseIf RndN = 1 Then
  1251.   endstr$ = endstr$ + " itself"
  1252.   ElseIf RndN = 2 Then
  1253.   endstr$ = endstr$ + " in a"
  1254.   ElseIf RndN = 3 Then
  1255.   endstr$ = endstr$ + " by"
  1256.   End If
  1257. ElseIf Mid$(Text$, i, 1) = "f" Then
  1258.   If RndN = 0 Then
  1259.   endstr$ = endstr$ + " it is"
  1260.   ElseIf RndN = 1 Then
  1261.   endstr$ = endstr$ + " sea"
  1262.   ElseIf RndN = 2 Then
  1263.   endstr$ = endstr$ + " myself"
  1264.   ElseIf RndN = 3 Then
  1265.   endstr$ = endstr$ + " powerful"
  1266.   End If
  1267. ElseIf Mid$(Text$, i, 1) = "g" Then
  1268.   If RndN = 0 Then
  1269.   endstr$ = endstr$ + " aren't"
  1270.   ElseIf RndN = 1 Then
  1271.   endstr$ = endstr$ + " nail filer"
  1272.   ElseIf RndN = 2 Then
  1273.   endstr$ = endstr$ + " everlasting"
  1274.   ElseIf RndN = 3 Then
  1275.   endstr$ = endstr$ + " magic"
  1276.   End If
  1277. ElseIf Mid$(Text$, i, 1) = "h" Then
  1278.   If RndN = 0 Then
  1279.   endstr$ = endstr$ + " tomorrow"
  1280.   ElseIf RndN = 1 Then
  1281.   endstr$ = endstr$ + " tree"
  1282.   ElseIf RndN = 2 Then
  1283.   endstr$ = endstr$ + " it will"
  1284.   ElseIf RndN = 3 Then
  1285.   endstr$ = endstr$ + " fat"
  1286.   End If
  1287. ElseIf Mid$(Text$, i, 1) = "i" Then
  1288.   If RndN = 0 Then
  1289.   endstr$ = endstr$ + " isn't"
  1290.   ElseIf RndN = 1 Then
  1291.   endstr$ = endstr$ + " explosion"
  1292.   ElseIf RndN = 2 Then
  1293.   endstr$ = endstr$ + " at school"
  1294.   ElseIf RndN = 3 Then
  1295.   endstr$ = endstr$ + " apples"
  1296.   End If
  1297. ElseIf Mid$(Text$, i, 1) = "j" Then
  1298.   If RndN = 0 Then
  1299.   endstr$ = endstr$ + " when"
  1300.   ElseIf RndN = 1 Then
  1301.   endstr$ = endstr$ + " onions"
  1302.   ElseIf RndN = 2 Then
  1303.   endstr$ = endstr$ + " night"
  1304.   ElseIf RndN = 3 Then
  1305.   endstr$ = endstr$ + " about it"
  1306.   End If
  1307. ElseIf Mid$(Text$, i, 1) = "k" Then
  1308.   If RndN = 0 Then
  1309.   endstr$ = endstr$ + " days"
  1310.   ElseIf RndN = 1 Then
  1311.   endstr$ = endstr$ + " right"
  1312.   ElseIf RndN = 2 Then
  1313.   endstr$ = endstr$ + " please"
  1314.   ElseIf RndN = 3 Then
  1315.   endstr$ = endstr$ + " oranges"
  1316.   End If
  1317. ElseIf Mid$(Text$, i, 1) = "l" Then
  1318.   If RndN = 0 Then
  1319.   endstr$ = endstr$ + " wrong"
  1320.   ElseIf RndN = 1 Then
  1321.   endstr$ = endstr$ + " yesterday"
  1322.   ElseIf RndN = 2 Then
  1323.   endstr$ = endstr$ + " has"
  1324.   ElseIf RndN = 3 Then
  1325.   endstr$ = endstr$ + " money"
  1326.   End If
  1327. ElseIf Mid$(Text$, i, 1) = "m" Then
  1328.   If RndN = 0 Then
  1329.   endstr$ = endstr$ + " today"
  1330.   ElseIf RndN = 1 Then
  1331.   endstr$ = endstr$ + " dad"
  1332.   ElseIf RndN = 2 Then
  1333.   endstr$ = endstr$ + " mother"
  1334.   ElseIf RndN = 3 Then
  1335.   endstr$ = endstr$ + " his"
  1336.   End If
  1337. ElseIf Mid$(Text$, i, 1) = "n" Then
  1338.   If RndN = 0 Then
  1339.   endstr$ = endstr$ + " french"
  1340.   ElseIf RndN = 1 Then
  1341.   endstr$ = endstr$ + " hurt"
  1342.   ElseIf RndN = 2 Then
  1343.   endstr$ = endstr$ + " ham"
  1344.   ElseIf RndN = 3 Then
  1345.   endstr$ = endstr$ + " milk"
  1346.   End If
  1347. ElseIf Mid$(Text$, i, 1) = "o" Then
  1348.   If RndN = 0 Then
  1349.   endstr$ = endstr$ + " not"
  1350.   ElseIf RndN = 1 Then
  1351.   endstr$ = endstr$ + " see you"
  1352.   ElseIf RndN = 2 Then
  1353.   endstr$ = endstr$ + " rot"
  1354.   ElseIf RndN = 3 Then
  1355.   endstr$ = endstr$ + " five"
  1356.   End If
  1357. ElseIf Mid$(Text$, i, 1) = "p" Then
  1358.   If RndN = 0 Then
  1359.   endstr$ = endstr$ + " see me"
  1360.   ElseIf RndN = 1 Then
  1361.   endstr$ = endstr$ + " hard"
  1362.   ElseIf RndN = 2 Then
  1363.   endstr$ = endstr$ + " mask"
  1364.   ElseIf RndN = 3 Then
  1365.   endstr$ = endstr$ + " ants"
  1366.   End If
  1367. ElseIf Mid$(Text$, i, 1) = "q" Then
  1368.   If RndN = 0 Then
  1369.   endstr$ = endstr$ + " yes"
  1370.   ElseIf RndN = 1 Then
  1371.   endstr$ = endstr$ + " soft"
  1372.   ElseIf RndN = 2 Then
  1373.   endstr$ = endstr$ + " four"
  1374.   ElseIf RndN = 3 Then
  1375.   endstr$ = endstr$ + " in flour"
  1376.   End If
  1377. ElseIf Mid$(Text$, i, 1) = "r" Then
  1378.   If RndN = 0 Then
  1379.   endstr$ = endstr$ + " no"
  1380.   ElseIf RndN = 1 Then
  1381.   endstr$ = endstr$ + " fast"
  1382.   ElseIf RndN = 2 Then
  1383.   endstr$ = endstr$ + " three"
  1384.   ElseIf RndN = 3 Then
  1385.   endstr$ = endstr$ + " cat"
  1386.   End If
  1387. ElseIf Mid$(Text$, i, 1) = "s" Then
  1388.   If RndN = 0 Then
  1389.   endstr$ = endstr$ + " slow"
  1390.   ElseIf RndN = 1 Then
  1391.   endstr$ = endstr$ + " super"
  1392.   ElseIf RndN = 2 Then
  1393.   endstr$ = endstr$ + " two"
  1394.   ElseIf RndN = 3 Then
  1395.   endstr$ = endstr$ + " over the"
  1396.   End If
  1397. ElseIf Mid$(Text$, i, 1) = "t" Then
  1398.   If RndN = 0 Then
  1399.   endstr$ = endstr$ + " medium"
  1400.   ElseIf RndN = 1 Then
  1401.   endstr$ = endstr$ + " hit"
  1402.   ElseIf RndN = 2 Then
  1403.   endstr$ = endstr$ + " one"
  1404.   ElseIf RndN = 3 Then
  1405.   endstr$ = endstr$ + " rainbow"
  1406.   End If
  1407. ElseIf Mid$(Text$, i, 1) = "u" Then
  1408.   If RndN = 0 Then
  1409.   endstr$ = endstr$ + " zero"
  1410.   ElseIf RndN = 1 Then
  1411.   endstr$ = endstr$ + " fire"
  1412.   ElseIf RndN = 2 Then
  1413.   endstr$ = endstr$ + " ice"
  1414.   ElseIf RndN = 3 Then
  1415.   endstr$ = endstr$ + " malt"
  1416.   End If
  1417. ElseIf Mid$(Text$, i, 1) = "v" Then
  1418.   If RndN = 0 Then
  1419.   endstr$ = endstr$ + " six"
  1420.   ElseIf RndN = 1 Then
  1421.   endstr$ = endstr$ + " hair"
  1422.   ElseIf RndN = 2 Then
  1423.   endstr$ = endstr$ + " light switch"
  1424.   ElseIf RndN = 3 Then
  1425.   endstr$ = endstr$ + " metal"
  1426.   End If
  1427. ElseIf Mid$(Text$, i, 1) = "w" Then
  1428.   If RndN = 0 Then
  1429.   endstr$ = endstr$ + " computer"
  1430.   ElseIf RndN = 1 Then
  1431.   endstr$ = endstr$ + " comb"
  1432.   ElseIf RndN = 2 Then
  1433.   endstr$ = endstr$ + " bomb"
  1434.   ElseIf RndN = 3 Then
  1435.   endstr$ = endstr$ + " writing"
  1436.   End If
  1437. ElseIf Mid$(Text$, i, 1) = "x" Then
  1438.   If RndN = 0 Then
  1439.   endstr$ = endstr$ + " eight ball"
  1440.   ElseIf RndN = 1 Then
  1441.   endstr$ = endstr$ + " smear"
  1442.   ElseIf RndN = 2 Then
  1443.   endstr$ = endstr$ + " letter"
  1444.   ElseIf RndN = 3 Then
  1445.   endstr$ = endstr$ + " cups"
  1446.   End If
  1447. ElseIf Mid$(Text$, i, 1) = "y" Then
  1448.   If RndN = 0 Then
  1449.   endstr$ = endstr$ + " nine"
  1450.   ElseIf RndN = 1 Then
  1451.   endstr$ = endstr$ + " table"
  1452.   ElseIf RndN = 2 Then
  1453.   endstr$ = endstr$ + " basket"
  1454.   ElseIf RndN = 3 Then
  1455.   endstr$ = endstr$ + " open door"
  1456.   End If
  1457. ElseIf Mid$(Text$, i, 1) = "z" Then
  1458.   If RndN = 0 Then
  1459.   endstr$ = endstr$ + " ten"
  1460.   ElseIf RndN = 1 Then
  1461.   endstr$ = endstr$ + " to car"
  1462.   ElseIf RndN = 2 Then
  1463.   endstr$ = endstr$ + " hallway"
  1464.   ElseIf RndN = 3 Then
  1465.   endstr$ = endstr$ + " in house"
  1466.   End If
  1467. Else
  1468. endstr$ = endstr$ + Mid$(Text$, i, 1)
  1469. End If
  1470. Next i
  1471. endstr$ = Mid$(endstr$, 2, Len(endstr$) - 1)
  1472. Code1 = endstr$
  1473. Exit Function
  1474. error:  MsgBox Err.Description, vbExclamation, "Error"
  1475. End Function
  1476.  
  1477. Function Code2(Text As String)
  1478. 'This is a simpler (and smaller) coding system than code 1
  1479. On Error GoTo error
  1480. Text$ = ReplaceC(Text$, "  ", ";")
  1481. Text$ = ReplaceC(Text$, " ", ",")
  1482. Text$ = ReplaceC(Text$, "A", "a")
  1483. Text$ = ReplaceC(Text$, "B", "b")
  1484. Text$ = ReplaceC(Text$, "C", "c")
  1485. Text$ = ReplaceC(Text$, "D", "d")
  1486. Text$ = ReplaceC(Text$, "E", "e")
  1487. Text$ = ReplaceC(Text$, "F", "f")
  1488. Text$ = ReplaceC(Text$, "G", "g")
  1489. Text$ = ReplaceC(Text$, "H", "h")
  1490. Text$ = ReplaceC(Text$, "I", "i")
  1491. Text$ = ReplaceC(Text$, "J", "j")
  1492. Text$ = ReplaceC(Text$, "K", "k")
  1493. Text$ = ReplaceC(Text$, "L", "l")
  1494. Text$ = ReplaceC(Text$, "M", "m")
  1495. Text$ = ReplaceC(Text$, "N", "n")
  1496. Text$ = ReplaceC(Text$, "O", "o")
  1497. Text$ = ReplaceC(Text$, "P", "p")
  1498. Text$ = ReplaceC(Text$, "Q", "q")
  1499. Text$ = ReplaceC(Text$, "R", "r")
  1500. Text$ = ReplaceC(Text$, "S", "s")
  1501. Text$ = ReplaceC(Text$, "T", "t")
  1502. Text$ = ReplaceC(Text$, "U", "u")
  1503. Text$ = ReplaceC(Text$, "V", "v")
  1504. Text$ = ReplaceC(Text$, "W", "w")
  1505. Text$ = ReplaceC(Text$, "X", "x")
  1506. Text$ = ReplaceC(Text$, "Y", "y")
  1507. Text$ = ReplaceC(Text$, "Z", "z")
  1508. Text$ = ReplaceC(Text$, "a", " IT")
  1509. Text$ = ReplaceC(Text$, "b", " AE")
  1510. Text$ = ReplaceC(Text$, "c", " TA")
  1511. Text$ = ReplaceC(Text$, "d", " EA")
  1512. Text$ = ReplaceC(Text$, "e", " NA")
  1513. Text$ = ReplaceC(Text$, "f", " NT")
  1514. Text$ = ReplaceC(Text$, "g", " IE")
  1515. Text$ = ReplaceC(Text$, "h", " NN")
  1516. Text$ = ReplaceC(Text$, "i", " TE")
  1517. Text$ = ReplaceC(Text$, "j", " EI")
  1518. Text$ = ReplaceC(Text$, "k", " TI")
  1519. Text$ = ReplaceC(Text$, "l", " II")
  1520. Text$ = ReplaceC(Text$, "m", " NE")
  1521. Text$ = ReplaceC(Text$, "n", " AI")
  1522. Text$ = ReplaceC(Text$, "o", " TN")
  1523. Text$ = ReplaceC(Text$, "p", " AA")
  1524. Text$ = ReplaceC(Text$, "q", " EN")
  1525. Text$ = ReplaceC(Text$, "r", " IN")
  1526. Text$ = ReplaceC(Text$, "s", " AT")
  1527. Text$ = ReplaceC(Text$, "t", " AN")
  1528. Text$ = ReplaceC(Text$, "u", " NI")
  1529. Text$ = ReplaceC(Text$, "v", " EE")
  1530. Text$ = ReplaceC(Text$, "w", " TT")
  1531. Text$ = ReplaceC(Text$, "x", " XX")
  1532. Text$ = ReplaceC(Text$, "y", " ET")
  1533. Text$ = ReplaceC(Text$, "z", " IA")
  1534. Text$ = Mid$(Text$, 2, Len(Text$) - 1)
  1535. Code2 = Text$
  1536. Exit Function
  1537. error:  MsgBox Err.Description, vbExclamation, "Error"
  1538. End Function
  1539.  
  1540. Function Decode1(Text As String)
  1541. 'This decodes text coded by code 1
  1542. On Error GoTo error
  1543. Text$ = " " & Text$
  1544. Text$ = ReplaceC(Text$, " somewhere", "a")
  1545. Text$ = ReplaceC(Text$, " did you", "a")
  1546. Text$ = ReplaceC(Text$, " flowers", "a")
  1547. Text$ = ReplaceC(Text$, " eat food", "a")
  1548. Text$ = ReplaceC(Text$, " light candle", "b")
  1549. Text$ = ReplaceC(Text$, " mirror", "b")
  1550. Text$ = ReplaceC(Text$, " cold soup", "b")
  1551. Text$ = ReplaceC(Text$, " video tape", "b")
  1552. Text$ = ReplaceC(Text$, " the murder", "c")
  1553. Text$ = ReplaceC(Text$, " read book", "c")
  1554. Text$ = ReplaceC(Text$, " the show", "c")
  1555. Text$ = ReplaceC(Text$, " paper", "c")
  1556. Text$ = ReplaceC(Text$, " beautiful", "d")
  1557. Text$ = ReplaceC(Text$, " do not", "d")
  1558. Text$ = ReplaceC(Text$, " bring", "d")
  1559. Text$ = ReplaceC(Text$, " that", "d")
  1560. Text$ = ReplaceC(Text$, " star", "e")
  1561. Text$ = ReplaceC(Text$, " itself", "e")
  1562. Text$ = ReplaceC(Text$, " in a", "e")
  1563. Text$ = ReplaceC(Text$, " by", "e")
  1564. Text$ = ReplaceC(Text$, " it is", "f")
  1565. Text$ = ReplaceC(Text$, " sea", "f")
  1566. Text$ = ReplaceC(Text$, " myself", "f")
  1567. Text$ = ReplaceC(Text$, " powerful", "f")
  1568. Text$ = ReplaceC(Text$, " aren't", "g")
  1569. Text$ = ReplaceC(Text$, " nail filer", "g")
  1570. Text$ = ReplaceC(Text$, " everlasting", "g")
  1571. Text$ = ReplaceC(Text$, " magic", "g")
  1572. Text$ = ReplaceC(Text$, " tomorrow", "h")
  1573. Text$ = ReplaceC(Text$, " tree", "h")
  1574. Text$ = ReplaceC(Text$, " it will", "h")
  1575. Text$ = ReplaceC(Text$, " fat", "h")
  1576. Text$ = ReplaceC(Text$, " isn't", "i")
  1577. Text$ = ReplaceC(Text$, " explosion", "i")
  1578. Text$ = ReplaceC(Text$, " at school", "i")
  1579. Text$ = ReplaceC(Text$, " apples", "i")
  1580. Text$ = ReplaceC(Text$, " when", "j")
  1581. Text$ = ReplaceC(Text$, " onions", "j")
  1582. Text$ = ReplaceC(Text$, " night", "j")
  1583. Text$ = ReplaceC(Text$, " about it", "j")
  1584. Text$ = ReplaceC(Text$, " days", "k")
  1585. Text$ = ReplaceC(Text$, " right", "k")
  1586. Text$ = ReplaceC(Text$, " please", "k")
  1587. Text$ = ReplaceC(Text$, " oranges", "k")
  1588. Text$ = ReplaceC(Text$, " wrong", "l")
  1589. Text$ = ReplaceC(Text$, " yesterday", "l")
  1590. Text$ = ReplaceC(Text$, " has", "l")
  1591. Text$ = ReplaceC(Text$, " money", "l")
  1592. Text$ = ReplaceC(Text$, " today", "m")
  1593. Text$ = ReplaceC(Text$, " had", "m")
  1594. Text$ = ReplaceC(Text$, " mother", "m")
  1595. Text$ = ReplaceC(Text$, " his", "m")
  1596. Text$ = ReplaceC(Text$, " french", "n")
  1597. Text$ = ReplaceC(Text$, " hurt", "n")
  1598. Text$ = ReplaceC(Text$, " ham", "n")
  1599. Text$ = ReplaceC(Text$, " milk", "n")
  1600. Text$ = ReplaceC(Text$, " not", "o")
  1601. Text$ = ReplaceC(Text$, " see you", "o")
  1602. Text$ = ReplaceC(Text$, " rot", "o")
  1603. Text$ = ReplaceC(Text$, " five", "o")
  1604. Text$ = ReplaceC(Text$, " see me", "p")
  1605. Text$ = ReplaceC(Text$, " hard", "p")
  1606. Text$ = ReplaceC(Text$, " mask", "p")
  1607. Text$ = ReplaceC(Text$, " ants", "p")
  1608. Text$ = ReplaceC(Text$, " yes", "q")
  1609. Text$ = ReplaceC(Text$, " soft", "q")
  1610. Text$ = ReplaceC(Text$, " four", "q")
  1611. Text$ = ReplaceC(Text$, " in flour", "q")
  1612. Text$ = ReplaceC(Text$, " no", "r")
  1613. Text$ = ReplaceC(Text$, " fast", "r")
  1614. Text$ = ReplaceC(Text$, " three", "r")
  1615. Text$ = ReplaceC(Text$, " cat", "r")
  1616. Text$ = ReplaceC(Text$, " slow", "s")
  1617. Text$ = ReplaceC(Text$, " super", "s")
  1618. Text$ = ReplaceC(Text$, " two", "s")
  1619. Text$ = ReplaceC(Text$, " over the", "s")
  1620. Text$ = ReplaceC(Text$, " medium", "t")
  1621. Text$ = ReplaceC(Text$, " hit", "t")
  1622. Text$ = ReplaceC(Text$, " one", "t")
  1623. Text$ = ReplaceC(Text$, " rainbow", "t")
  1624. Text$ = ReplaceC(Text$, " zero", "u")
  1625. Text$ = ReplaceC(Text$, " fire", "u")
  1626. Text$ = ReplaceC(Text$, " ice", "u")
  1627. Text$ = ReplaceC(Text$, " malt", "u")
  1628. Text$ = ReplaceC(Text$, " six", "v")
  1629. Text$ = ReplaceC(Text$, " hair", "v")
  1630. Text$ = ReplaceC(Text$, " light switch", "v")
  1631. Text$ = ReplaceC(Text$, " metal", "v")
  1632. Text$ = ReplaceC(Text$, " computer", "w")
  1633. Text$ = ReplaceC(Text$, " comb", "w")
  1634. Text$ = ReplaceC(Text$, " bomb", "w")
  1635. Text$ = ReplaceC(Text$, " writing", "w")
  1636. Text$ = ReplaceC(Text$, " eight ball", "x")
  1637. Text$ = ReplaceC(Text$, " smear", "x")
  1638. Text$ = ReplaceC(Text$, " letter", "x")
  1639. Text$ = ReplaceC(Text$, " cups", "x")
  1640. Text$ = ReplaceC(Text$, " nine", "y")
  1641. Text$ = ReplaceC(Text$, " table", "y")
  1642. Text$ = ReplaceC(Text$, " basket", "y")
  1643. Text$ = ReplaceC(Text$, " open door", "y")
  1644. Text$ = ReplaceC(Text$, " ten", "z")
  1645. Text$ = ReplaceC(Text$, " to car", "z")
  1646. Text$ = ReplaceC(Text$, " hallway", "z")
  1647. Text$ = ReplaceC(Text$, " in house", "z")
  1648. Text$ = ReplaceC(Text$, ";", "  ")
  1649. Text$ = ReplaceC(Text$, ",", " ")
  1650. Decode1 = Text$
  1651. Exit Function
  1652. error:  MsgBox Err.Description, vbExclamation, "Error"
  1653. End Function
  1654.  
  1655. Function Decode2(Text As String)
  1656. 'This decodes text coded by code 2
  1657. On Error GoTo error
  1658. Text$ = " " & Text$
  1659. Text$ = ReplaceC(Text$, " IT", "a")
  1660. Text$ = ReplaceC(Text$, " AE", "b")
  1661. Text$ = ReplaceC(Text$, " TA", "c")
  1662. Text$ = ReplaceC(Text$, " EA", "d")
  1663. Text$ = ReplaceC(Text$, " NA", "e")
  1664. Text$ = ReplaceC(Text$, " NT", "f")
  1665. Text$ = ReplaceC(Text$, " IE", "g")
  1666. Text$ = ReplaceC(Text$, " NN", "h")
  1667. Text$ = ReplaceC(Text$, " TE", "i")
  1668. Text$ = ReplaceC(Text$, " EI", "j")
  1669. Text$ = ReplaceC(Text$, " TI", "k")
  1670. Text$ = ReplaceC(Text$, " II", "l")
  1671. Text$ = ReplaceC(Text$, " NE", "m")
  1672. Text$ = ReplaceC(Text$, " AI", "n")
  1673. Text$ = ReplaceC(Text$, " TN", "o")
  1674. Text$ = ReplaceC(Text$, " AA", "p")
  1675. Text$ = ReplaceC(Text$, " EN", "q")
  1676. Text$ = ReplaceC(Text$, " IN", "r")
  1677. Text$ = ReplaceC(Text$, " AT", "s")
  1678. Text$ = ReplaceC(Text$, " AN", "t")
  1679. Text$ = ReplaceC(Text$, " NI", "u")
  1680. Text$ = ReplaceC(Text$, " EE", "v")
  1681. Text$ = ReplaceC(Text$, " TT", "w")
  1682. Text$ = ReplaceC(Text$, " XX", "x")
  1683. Text$ = ReplaceC(Text$, " ET", "y")
  1684. Text$ = ReplaceC(Text$, " IA", "z")
  1685. Text$ = ReplaceC(Text$, ";", "  ")
  1686. Text$ = ReplaceC(Text$, ",", " ")
  1687. Decode2 = Text$
  1688. Exit Function
  1689. error:  MsgBox Err.Description, vbExclamation, "Error"
  1690. End Function
  1691.  
  1692. Private Function ReplaceC(MainStr As String, OldStr As String, NewStr As String) As String
  1693. 'For Section 12 (Code/Decode):  Replaces one string with another
  1694. On Error GoTo error
  1695. ReplaceC = ""
  1696. Dim NewStrString As String
  1697. Dim i As Integer
  1698. For i = 1 To Len(MainStr)
  1699.   If Mid(MainStr, i, Len(OldStr)) = OldStr Then
  1700.   NewStrString = NewStrString & NewStr
  1701.   i = i + Len(OldStr) - 1
  1702.   Else
  1703.   NewStrString = NewStrString & Mid(MainStr, i, 1)
  1704.   End If
  1705. Next i
  1706. ReplaceC = NewStrString
  1707. Exit Function
  1708. error:  MsgBox Err.Description, vbExclamation, "Error"
  1709. End Function
  1710.  
  1711. 'Section 13:  Math
  1712.  
  1713. Function Add(num1 As Long, num2 As Long) As Long
  1714. 'Add two numbers
  1715. On Error GoTo error
  1716. Add = Val(num1) + Val(num2)
  1717. Exit Function
  1718. error:  MsgBox Err.Description, vbExclamation, "Error"
  1719. End Function
  1720.  
  1721. Function Subtract(num1 As Long, num2 As Long) As Long
  1722. 'Subtract two numbers
  1723. On Error GoTo error
  1724. Subtract = Val(num1) - Val(num2)
  1725. Exit Function
  1726. error:  MsgBox Err.Description, vbExclamation, "Error"
  1727. End Function
  1728.  
  1729. Function Divide(num1 As Long, num2 As Long) As Long
  1730. 'Divide two numbers
  1731. On Error GoTo error
  1732. Divide = Val(num1) / Val(num2)
  1733. Exit Function
  1734. error:  MsgBox Err.Description, vbExclamation, "Error"
  1735. End Function
  1736.  
  1737. Function Multiply(num1 As Long, num2 As Long) As Long
  1738. 'Multiply two numbers
  1739. On Error GoTo error
  1740. Multiply = Val(num1) * Val(num2)
  1741. Exit Function
  1742. error:  MsgBox Err.Description, vbExclamation, "Error"
  1743. End Function
  1744.  
  1745. Function ToPower(num1 As Long, num2 As Long) As Long
  1746. 'Bring num1 to the power (exponent) of num2
  1747. On Error GoTo error
  1748. ToPower = Val(num1) ^ Val(num2)
  1749. Exit Function
  1750. error:  MsgBox Err.Description, vbExclamation, "Error"
  1751. End Function
  1752.  
  1753. Function ToRoot(num1 As Long, num2 As Long) As Long
  1754. 'Bring num1 to the root of num2
  1755. On Error GoTo error
  1756. ToRoot = Val(num1) ^ (1 / Val(num2))
  1757. Exit Function
  1758. error:  MsgBox Err.Description, vbExclamation, "Error"
  1759. End Function
  1760.  
  1761. Function FractionToDecimal(numerator As Integer, denominator As Integer) As Long
  1762. 'Turns a fraction into a decimal
  1763. On Error GoTo error
  1764. FractionToDecimal = numerator / denominator
  1765. Exit Function
  1766. error:  MsgBox Err.Description, vbExclamation, "Error"
  1767. End Function
  1768.  
  1769. Function DecimalToPercentage(DecimalNum As Long) As String
  1770. 'Turns a decimal into a percentage
  1771. On Error GoTo error
  1772. DecimalToPercentage = (DecimalNum * 100) & "%"
  1773. Exit Function
  1774. error:  MsgBox Err.Description, vbExclamation, "Error"
  1775. End Function
  1776.  
  1777. Function PercentageToDeciaml(PercentNum As String) As Long
  1778. 'Turns a percentage into a decimal
  1779. On Error GoTo error
  1780. If Mid$(PercentNum$, Len(PercentNum$), 1) = "%" Then
  1781. PercentNum$ = Mid$(PercentNum$, 2, Len(PercentNum$) - 1)
  1782. End If
  1783. PercentageToDecimal = Val(PercentNum$) / 100
  1784. Exit Function
  1785. error:  MsgBox Err.Description, vbExclamation, "Error"
  1786. End Function
  1787.  
  1788. Function AreaOfCircle(radius As Long)
  1789. 'Gets the area of a circle
  1790. On Error GoTo error
  1791. pi = 3.141592654
  1792. AreaOfCircle = pi * (radius ^ 2)
  1793. Exit Function
  1794. error:  MsgBox Err.Description, vbExclamation, "Error"
  1795. End Function
  1796.  
  1797. Function Circumference(radius As Long)
  1798. 'Gets the circumference of a circle
  1799. On Error GoTo error
  1800. pi = 3.141592654
  1801. Circumference = pi * 2 * radius
  1802. Exit Function
  1803. error:  MsgBox Err.Description, vbExclamation, "Error"
  1804. End Function
  1805.  
  1806. Function AreaOfSquare(side As Long)
  1807. 'Gets the area of a square
  1808. On Error GoTo error
  1809. AreaOfSquare = side ^ 2
  1810. Exit Function
  1811. error:  MsgBox Err.Description, vbExclamation, "Error"
  1812. End Function
  1813.  
  1814. Function PerimeterOfSquare(side As Long)
  1815. 'Gets the perimeter of a square
  1816. On Error GoTo error
  1817. PerimeterOfSquare = 4 * side
  1818. Exit Function
  1819. error:  MsgBox Err.Description, vbExclamation, "Error"
  1820. End Function
  1821.  
  1822. Function PerimeterOfRectangle(Length As Long, width As Long)
  1823. 'Gets the perimeter of a rectangle
  1824. On Error GoTo error
  1825. PerimeterOfRectangle = (2 * Length) + (2 * width)
  1826. Exit Function
  1827. error:  MsgBox Err.Description, vbExclamation, "Error"
  1828. End Function
  1829.  
  1830. Function AreaOfRectangle(Length As Long, width As Long)
  1831. 'Gets the area of a rectangle
  1832. On Error GoTo error
  1833. AreaOfRectangle = Length * width
  1834. Exit Function
  1835. error:  MsgBox Err.Description, vbExclamation, "Error"
  1836. End Function
  1837.  
  1838. Function AreaOfTriangle(base As Long, height As Long)
  1839. 'Gets the area of a triangle
  1840. On Error GoTo error
  1841. AreaOfTriangle = (1 / 2) * base * height
  1842. Exit Function
  1843. error:  MsgBox Err.Description, vbExclamation, "Error"
  1844. End Function
  1845.  
  1846. Function PerimeterOfTriangle(side1 As Long, side2 As Long, side3 As Long)
  1847. 'Gets the perimeter of a triangle
  1848. On Error GoTo error
  1849. PerimeterOfTriangle = side1 + side2 + side3
  1850. Exit Function
  1851. error:  MsgBox Err.Description, vbExclamation, "Error"
  1852. End Function
  1853.  
  1854. Function PerimeterOf4SidedPolygon(side1 As Long, side2 As Long, side3 As Long, side4 As Long)
  1855. 'Gets the perimeter of any 4 sided polygon
  1856. On Error GoTo error
  1857. PerimeterOf4SidedPolygon = side1 + side2 + side3 + side4
  1858. Exit Function
  1859. error:  MsgBox Err.Description, vbExclamation, "Error"
  1860. End Function
  1861.  
  1862. Function VolumeOfCube(edge As Long)
  1863. 'Gets the volume of a cube
  1864. On Error GoTo error
  1865. VolumeOfCube = edge ^ 3
  1866. Exit Function
  1867. error:  MsgBox Err.Description, vbExclamation, "Error"
  1868. End Function
  1869.  
  1870. Function VolumeOfPrism(base As Long, height As Long)
  1871. 'Gets the volume of a prism
  1872. On Error GoTo error
  1873. VolumeOfPrism = base * height
  1874. Exit Function
  1875. error:  MsgBox Err.Description, vbExclamation, "Error"
  1876. End Function
  1877.  
  1878. Function VolumeOfSphere(radius As Long)
  1879. 'Gets the volume of a sphere
  1880. On Error GoTo error
  1881. pi = 3.141592654
  1882. VolumeOfSphere = (4 / 3) * pi * (radius ^ 3)
  1883. Exit Function
  1884. error:  MsgBox Err.Description, vbExclamation, "Error"
  1885. End Function
  1886.  
  1887. Function VolumeOfPyramid(base As Long, height As Long)
  1888. 'Gets the volume of a pyramid
  1889. On Error GoTo error
  1890. VolumeOfPyramid = (1 / 3) * base * height
  1891. Exit Function
  1892. error:  MsgBox Err.Description, vbExclamation, "Error"
  1893. End Function
  1894.  
  1895. Function VolumeOfCone(radius As Long, height As Long)
  1896. 'Gets the volume of a cone
  1897. On Error GoTo error
  1898. pi = 3.141592654
  1899. VolumeOfCone = (1 / 3) * pi * (radius ^ 2) * height
  1900. Exit Function
  1901. error:  MsgBox Err.Description, vbExclamation, "Error"
  1902. End Function
  1903.  
  1904. Function VolumeOfCylinder(radius As Long, height As Long)
  1905. 'Gets the volume of a cylinder
  1906. On Error GoTo error
  1907. pi = 3.141592654
  1908. VolumeOfCylinder = pi * height * (radius ^ 2)
  1909. Exit Function
  1910. error:  MsgBox Err.Description, vbExclamation, "Error"
  1911. End Function
  1912.  
  1913. 'Section 14:  Color Fading
  1914.  
  1915. Function FadeThreeColorHTML(R1%, G1%, B1%, R2%, G2%, B2%, R3%, G3%, B3%, TheText$)
  1916. 'This will fade three colors in HTML color coding
  1917. On Error GoTo error
  1918. textlen% = Len(TheText)
  1919. fstlen% = (Int(textlen%) / 2)
  1920. part1$ = Left(TheText, fstlen%)
  1921. part2$ = Right(TheText, textlen% - fstlen%)
  1922. textlen% = Len(part1$)
  1923. For i = 1 To textlen%
  1924. TextDone$ = Left(part1$, ind ch"
  1925.   El6pi = 3.141592654
  1926. Circumfer(yator As Integer, denomino&c GoTo $, "9&c GoTo $,mationor
  1927. pi = 3.14Inteonor
  1928. pi Nxt$,oheText
  1929. End FLheText
  1930. EndeText
  1931. ]l+ " se=6J6x=D;\
  1932. End Fun (6J6x=DtrRdstr$ D;\
  1933. Enoiter.Print g, side2 As Long, side3 As Long)
  1934. ong
  1935. DiNxt$,ohnteger, denomino&c GoTo $, "9&c extlen Replacextlen Replacextlen ReplacextNrCr$ D;nolen rginSize%);
  1936. End If
  1937. Printer.EndDoc
  1938. Exit Sub
  1939. errorjl)
  1940. Text$ = ReplaceCceCn
  1941. = 3.14Inteonor
  1942. pi Nxt$,oheText
  1943. E2x2ceCn
  1944. ominoLeft(TheText, fstlen%placeC(MainSt2x2c
  1945. On Error GoTo error
  1946. pi = 3.1415926)
  1947. Text$ = ReplaceC(Text$, " com4]l Then
  1948. =6J6x=DSub
  1949. errorjl)
  1950. Te2Doc
  1951. Et, fstlen%placeCstlen%pCylin Err.Dtion
  1952. lin h, 4ectext b
  1953. erra
  1954. 'Ge%plac
  1955. FractionToDecimaFractionToDecimaFractionToDecimaFracti2 hFunction RtNTo err, "9teonor
  1956. pi scription, vbExclamation, "Error"
  1957. End Function
  1958.  
  1959.           pOptions, DvbExclavbExclamatitinoLeAen Replacextlen REt, fstlen%p6rt1$m
  1960. ScreenToClient Frm.hWnd, lpTL
  1961. ScreenToClient Frm.r
  1962. Call SetWindowPos(FormceC(Text$, " ice", "u")
  1963. Text$ =wPos(FormceC(Text$, " ice", "u")
  1964. Text$ =wPos(FormceCed polygon
  1965. On Error GoTo error
  1966. PerbnoLeAen RwPoTonor
  1967. pi scription, vbExclamachanges pce", "Axclamachanges pce", "Axclamachanges pce", "Axclamachanges pce", "Axclamachanges pce", "Axclam(ForhWnd, "n")
  1968. Text$ = ReplaceC(Texte", "Axclamachanges pce", "Axclam(ForhWnd, "n")
  1969. Text$ = Rce", "h", "Axclj (Oext$,1xclj (Oext$
  1970. Text$ = R.141592654e", ",matiTonor
  1971. pi scr=)
  1972. Temachanges pce", "Ace"l"t")
  1973. =)
  1974. TemAy,eOf CEA5z, "n")
  1975. Text$t")
  1976. s)
  1977. =)
  1978. TemAy,eOf CEAEtion
  1979. lin h, 4ectext b
  1980. errs)
  1981. Text$ =eC(Texte", "AmAy$aon
  1982.  
  1983.   0ion, vbExclamationrrs)1, " $aon
  1984. 3.1415926)
  1985. Text$ = ReplaceC(TextsCid$(Peigh$,   endstr$ =n0ce", "Axou=n0ce", "$
  1986.    tumeOfSphere(radius As LionToDydius t1$m
  1987. ScreenToClient Frm.hWnd, lpTL
  1988. ScreenToClient Frm.r
  1989. Call SetWindowP6P(nction Vol, "Axcl rctFrame.RendowP6P(nction Client m.hWSce"iptionction
  1990. ylus As LionToDydius t1$m
  1991. Screeemachanm 0ion, vbExclamationroclamationroclamationroclamationrtionroft$, "c", = R.141592654e", ",matiTonor
  1992.    tumeOfContion
  1993. e)
  1994.             iVal = WSACleanur4    tione", "An + ition
  1995. e)
  1996.     xt$ = RepErro bmatiTonor
  1997.    tumeOfContion
  1998. e)
  1999.  t Frm.r
  2000. Clonrocleanunroceeemachanmf Rnt"emachanmfso\ide = Val(num1) / Val(num2)
  2001. g$ = Replr
  2002. ox Eion
  2003. eError GoTo error
  2004. VolumeOfPyramid = (1 / 3) * base * height
  2005. Exit Fxcl rc4Intf Rnt"emachanmfso\ide = Val(num1) fl)
  2006. E  a rectangle
  2007. On Erroript╚G "k")
  2008. Text$ = ReplaceC(Text$, " II", "lem.hWTo textlen%
  2009. T GoTo errsideWTo textlen%
  2010. T GoTo errt╚G "k")
  2011. Text$ = ReplaceC(Text$, yntNtox Eion
  2012. iClient Frm.r
  2013. Call SetWindowP6P(nction Vol, "Axcl rdstr$ = end
  2014. T GoTo errt╚G "k")
  2015. Text$Axcll SetWiyl(num1$"h")
  2016. (Text$, " hard", "p")
  2017. Text$ = ReplaceC(Text$, " mask", "p")
  2018. Text$ = ReplaceC(Text$, "mMinium2)um1$"nctio Replace:  MsgBox Erext$:C(Text$, GoText$, " mask", "p")
  2019. Text$ = ReplaceC(Text$, "mMinium2)um1$"nctio Replace:  MsgBox Erext$:C(Text$, GoText$, " mask", "p")
  2020. Text$ = ReplaceC(Text$, "mMinium2)um1$"nctio Replace:  MsgBox Erext$:C(Text$, GoText$, " mask", "p")
  2021. Text$ = ReplaceC(Text$, "mMinium2")
  2022. Tex = Repnor
  2023.    tumtxBC(Text$, GoText$, " mask",Text$, nor
  2024.  $, " mask", r
  2025.  WReplaceC(Text$, "mMinium2")
  2026. Tex = Repnor
  2027.    tumtxBC(Text$, GoText$, " mask",Text$, nor
  2028.  $, " mask", r
  2029.  WReplaceC(Text$, "mMinium2")
  2030. Tex = Repnor
  2031.    tumtxBC(Text$, GoText$, " mask",Text$, nor
  2032.  $, " mask", r
  2033.  WReplaceC(Text$, "mMinium2")
  2034. Tex = Repnor
  2035. GoText$P0ong)
  2036. 'Gets the area of a triangleDEmask", r
  2037.  WRepeX2sk",Text$, nor
  2038.  $, " mask", r
  2039.  WReplacNox Err.Descriptio
  2040. Text$ = Re6For iium2)um1$"nctition
  2041. er iium2)um1c+m1c+msNoi= Replm1c+msNox Err.DesufcArr.DesufcArr.DesufcArr.DesufcArr.DesufcArrction
  2042.  
  2043. 'Se_
  2044. a'Se_
  2045. nSize%);
  2046. End O)$,o= R3o
  2047. "tWie_
  2048. a'Se_
  2049. nSize%);
  2050. EEY
  2051. TexPeEyRf
  2052. ElseIf Mid$(Text$, i, 1) "x")
  2053. TePeEyfcArrctiu5,o= R3o
  2054. "tWie_
  2055. a'Se_
  2056. nSize%);
  2057. EEY
  2058. TexPeEyRf
  2059. ElseIf Mid$(Text$, i R3o
  2060. "eseIf
  2061. En3o
  2062. "eseIf
  2063. En3o
  2064. "eseIf
  2065. En3o = "h"xitu
  2066. En3o = seIf
  2067. ETn3o = sext$eIf
  2068. ETn3o = sext$eIf
  2069. ETn3o = sext$eIf
  2070. ETn3o = sext$ece",etion
  2071. er iium2)um1c+m1c+msNoi= Replmfr
  2072. c3M= sext$e   hFil3o = hc+msNa, side3 As Long)
  2073. ong
  2074. DiNxt$,ohb, "e")
  2075. Textext$n(z.hWnd, lpTL
  2076. ScreenToClient Frm.r
  2077. Call SetWindowP6P( Frmsext$e   hFil3o = hc+msNa, side3 Npext$,olaceC(Text$, " II", "lem.hWTo texaoClt$,olaceC(Text$,mtxBC(Tx II",de axt$, GoText$, " mask",Text$, nor
  2078.  $, " mask", r
  2079.  W
  2080. a'Se_
  2081. nSize%);
  2082. ReplaceC(Text$, " EA", "d")
  2083. Text$ = ReplaceC(Text$, " NA", "e")
  2084. Text$, (kd EA"ask",TexBtlEindowP6P(nction Vol, "Axcl rctFrame
  2085. "tWie_
  2086. a'Se_
  2087. nSize%);
  2088. Et$,B
  2089. 'Secy, "r);
  2090. Et$&TAs L.Des r
  2091.    Pub
  2092. wid = asEt$&TAs L.Des r
  2093.    Pub
  2094. wid = asEt$&TAs L.Des r
  2095.    Pub
  2096. wid = asEt$&TAs L.Des r
  2097.    Pub
  2098. wid = asEt$&TAs L.Des asEt$&TAreTx -
  2099. wid TAs brb
  2100. wid eOi-es asMeTx   "ElseIf RndN = 1 aceC(Tgs rG RndN = 1 $lseScreenrC(TeAs L.Des asEt$&Tpcdst(iEt$&TAs ", r
  2101. (s1bleAs L.Des asEt$&Tpcdst(iEt$&TAs ", r
  2102. (s1bleAs L.Des asEt$&Tpcdst(iEt$&TAs ", r
  2103. (s1bleAs L.Des asEt$&Tpcdst(iEt$&TAs ", r
  2104. (s1bleAs L.Des asEt$&Tpcdst(iEt$&TAs(h see th% =ss"
  2105. (0, 0, wire thL.Des r
  2106.    Pub,o
  2107.   "
  2108. Endd  Pu=error
  2109. If
  2110.  asEtDecimalNum As Long) As String
  2111. 'Turns a decimal into a percentage
  2112. On Error GoTo error
  2113. DecimalToPercentae
  2114. On Error GReplE
  2115. Dlo = asESub
  2116. sS2On Error GReplE
  2117. Dlo = asESub
  2118. sS2On Error"e"
  2119.   r = c(h seexcl"
  2120.   r =$s
  2121. Exi  Pub
  2122. xrro(OYor
  2123. If
  2124. oub,o
  2125.  O Then
  2126. Then
  2127. Then
  2128. Then
  2129. Then
  2130. Then
  2131. Then
  2132. Tc2en Rendstr(hen
  2133.  =e"
  2134.   2iftlenn E=t WReplptions, DvbExclavbExclamatitinoLeAen Replacextlen REt, fstleub
  2135. xr (endstr(hen
  2136.  p(hen
  2137.  =e"
  2138.   2iftlenn E=t WReplptions, DvbExclavbExclamatitinoLeAen Replacextlen REt, fstleub
  2139. xr (
  2140. End O)$,o= R3o
  2141. "tWiePub,o
  2142.   "
  2143. Endd  Pu=id = asEt$&TAs L.Des asEt$&TAreTx3o = li* (End AdAs L54rxbrtEnd Error GoTCnr
  2144.     Dim lGoTCnr
  2145.     Dim lGoTrror GoTG
  2146.     Dim lGoTCnr
  2147.     Dim lGoTrr(ion
  2148.  
  2149. 'Section 13:rspDim lGoTrr(ion
  2150. x(eexcl"
  2151.   r =$s
  2152. Exi  Pub
  2153. xrro(OYor
  2154. If
  2155. ohM
  2156. 'ShM
  2157. 'S    Dim lGoTrr(ion
  2158.  
  2159. 'Secrrorb,o
  2160.   "
  2161. Endd  Pu=id = a fstl) Dim lGoTrror |
  2162.     Dim liim lGoTrror |
  2163.     Dim liim lGoTrror |
  2164.     Dir(hI
  2165.  
  2166. ',, vbExclamation, "Error"
  2167. End Function
  2168.  
  2169. Function "(askor |
  2170. pl= ReplaceC(Text$, " mask", "pU, = "hM
  2171. 'S  Dim lGoTrr(ion
  2172.  
  2173. 'Secrrorb,o
  2174.  AsShM
  2175. 'S  N = 3 Th 2) *t$ = ReplaceC(Text$h( DimArr$, " mask", "pU, = "hMl(nuc, Len(0a(ph(Int(textlen%) / 2)
  2176. part1$ = Le.Ref0aAs L.Des r
  2177. %)
  2178. part2$ = Right(TheText, tex
  2179.    Pubfstlen%)
  2180. textlen% = Len(part1$Y$ceC(Text$, "r", " In, "Erf0an.Des r
  2181. %)
  2182. part2$ = Rxt$, = "hMl(nuc, Len(0a(ph(Int(textlen 0 Then
  2183.   endstr$ lGoTo e0ang)
  2184. 'Gf0aeEyRf
  2185. hen
  2186.  rTemp, InStr(strTethM
  2187. 'S  DR (um Aid$(Text,ption, vbExclamation, "Error"
  2188.   Dimid$(TelaceC(Text$, "A", "a,r.dN = 3 Then
  2189.   endstr$ = endstr$ + " video NewSt*tion
  2190. 2ideo NewSt*tion
  2191. 2ideo NewSt*tion
  2192. 2ideo Newid$(TelaceC(Text$, "A" Long)
  2193. 'Getsxt,pSquare = side ^ 2
  2194. Exit Fr
  2195. part2$ "  =um$, Lclamation, "Error"
  2196. $p2  =um$, Lclamation, "Error"
  2197. $p2  =uentNum'Gets the perimeter $Wp
  2198. 'Getsxt,pSquare = s$A2)
  2199. Text$ = ReplaceC(Text$, "s", " AT Le.Reion
  2200. 2ideo NewSt*tion
  2201. 2ideo NewSt*tion
  2202. 2i$Dimid$(TelaceC(Endd  Pu=error
  2203. If
  2204.  asEtDecimalNum As Long) As String
  2205. 'Turns a decimal into a percentage
  2206. On Error GoToplE
  2207. Dlo = asESs As Long)
  2208. ', "A"u Le.Reionh2d  Pu=id = a fstl) Dim lGoTrror |
  2209.   h$(Te$ = ReplaceC(Text$, " see you", fstleub
  2210. xr (
  2211. End O)$,o= R3o
  2212. "tWiePub,o
  2213.   "
  2214. Endd  Pu=id = asEt$&TAs L.Des asEt$&TAreTx3o = li* (End AdAs L54rxbrtEnd Error GoTCnr
  2215.     Dim lGoTCnr
  2216.     Dim lGoTrror GoTG
  2217.     Dim lGoTCnr
  2218.     Dim lGoTrr(ion
  2219.  
  2220. 'Section 13:rspDim lGoTrr(ion
  2221. x(eexcl"
  2222.   r =Eion
  2223. 2i$D (
  2224. Ens = 2 Then
  2225.   endstr$ = endstr$ + " has"
  2226.  AT Le.Reion
  2227. 2ideo(x3o 
  2228. "tWinction
  2229.  
  2230. Funct2
  2231.  
  2232. Funct2
  2233.  
  2234. Funct2
  2235.  
  2236. Funct2
  2237.  
  2238. Funct2btim lGoTrror GoTG
  2239.     Dim lGoTCnr
  2240.     DiL.DeyNp
  2241. 'G  DiL.DeyNp
  2242. 'G  DiL.DeyNp
  2243. ,o
  2244.   "
  2245. 2i$D (xt$, "r", " In, "Erf0an.Des r
  2246. %)
  2247. part2
  2248. 'G  DiL.DeyNp
  2249. 'G  DiL.DeyNp
  2250. ,orror GoTG
  2251.     Dim lGoTCnr
  2252.     DiL.D
  2253. 'G  DiL.DeyB    Dimachanges pce", "Axclamac(t$, "X"bExclamatitinoLeAen Replacextle Dimachangseo NewSt*tmNewSt*tmNewSt*tmNewSt*tmNewSt*tmNewSt*tmNewSt*tmNewSt*tmNewSt*tmNewSt*tmNewSt*tmtr$ + " aren't"t   Dim lGo"dXtd O)$,o= R3o
  2254. "tWiePub,o
  2255.   "
  2256. Endd  Pu=id = Text$ = ReplaceC(CmNewewSt*tmwer = Val(num1) ^ VlaceC(CmNewewStex = RepnorceC(Cmseou
  2257. End Function
  2258.  
  2259. FunctpnorceC(yDimach
  2260.   seou
  2261. End Function
  2262.  
  2263. FunctpnorceC(yDia
  2264.  
  2265. t$, GoText$, 
  2266.   ElseIf RndN = 3 TrceC(yDia
  2267.  
  2268. t>lror GoTCnrr = ValDim lGoTtion
  2269.  
  2270. FunctpnorceC(yDia
  2271.  
  2272. ndN = 3 TrceCch
  2273.   m lGoTrndN = 3 TdN = 3p1_= Replac$, " o= R3o
  2274. "tWiePub,o
  2275.   "
  2276. Endd  Pu=id = Text$ = ReplaceC(CmNewewSt*tmwer = Val(num1) ^ VlaceC(CmNewewStex = RepnorceC(Cmseou
  2277. End Function
  2278.  
  2279. FunctpnorceY(lmagic", "uncrt2
  2280. 'G  DiLayNp, "a,fD
  2281. Ar(num1)PmN = 3p1_=io on
  2282. 2i$Dimid$(TelaceC(Endd  Pu=error
  2283. If
  2284.  asEtDecimalNum As Long) As String
  2285. 'Turns a decimal inS"a,fD
  2286. Ar(num1)PmN = 3p1_=dd s= ends2ide$ = Re,ns a = Re, 1) = "r" Then
  2287.   If RndN = Jerroriecimal eC(E  Dim liim lGoceC(Endd  P,= a fstl) Dim lGoTrror |ceC(Text$, "Q",   endBnorceC(Cmseou
  2288. End Function
  2289.  
  2290. FunctpnorceC(yDimach
  2291.   seou
  2292. End Function
  2293.  
  2294. FunctpnorceC(yDia
  2295.  
  2296. t$, GoTeu
  2297. End Functionets 
  2298. End ceC(yD Then
  2299.   If RndN = Jerroriecimal eC(E  Dim liim lGo$t")
  2300. ceC(Te2tion
  2301.  
  2302. Funct2Pu=itVoluariecimal eC(E  Dim liim lGo$t")
  2303. ceC(Te2tion
  2304.  
  2305. Funct2Pu=itVoluariecimal eC(E  Dim liim lGo$t")
  2306. ceC(Te2tion
  2307.  
  2308. Funct2Pu=itVoWWC(yDia
  2309.  
  2310. t$, GoTextCmNewewStTe2tion
  2311.  
  2312. "StTe2tion
  2313.  
  2314. "rcimal = Replimal = Ru1) ^ = Ru1) ^ =m lGo$twewStTe2tion
  2315.  
  2316. "StTe2tion
  2317.  
  2318. "rcimal =lGo$t")
  2319. cts 
  2320. End Functi.rror
  2321. te─be2tion
  2322.  
  2323. FuncCmNeon
  2324.  
  2325. Function "(askor |Rxl/= ReplaceC(Texion
  2326.  
  2327. FuncCmNeon
  2328.  
  2329. FunctF=m lG4rxbrtEnd Errm lG4ertE
  2330.  
  2331. Ft= 0 Then
  2332.   endstr$ = endstr$ + " when"
  2333.   ElseIf RndN(
  2334.   E Left(TheText, fstlenL(= endstr$ + " when"
  2335.   ElseIf RndN(
  2336.   Egion "( " AE"tee.r$ = WReplptions, DvbExclavbExclamatitinoLens, ExclavbExclamatitinoLeceC(Dimach when"
  2337.   ElseIf RndN(
  2338.   E L" AEk")
  2339. Text$ = RNon
  2340. dpare = side ^ 2
  2341. Exit Fr
  2342. part2ndsy_len:+ "Asof RndN = 3 Then
  2343.   H
  2344. Text$ = Raystem th Fr
  2345. part2nro
  2346. "tWlen
  2347. p$e2tion
  2348. yjim lFuncon
  2349. error:  MsgBox Err.Descripthen"
  2350. "
  2351.  n
  2352.  
  2353. rrDescriptng)
  2354. 'Gets the as
  2355. ExVoWWC(yDia
  2356.  
  2357. t$, GoTextCmNewewStTe2tion
  2358. " yest$s
  2359.   El  MsgfOEeWC(yDia
  2360. ∩M El imach when"
  2361.   ElseIf RndN(
  2362.   E L" AEg"( " AE"teeon
  2363.  
  2364. ideo NewSt*tioi(s$ =
  2365.  
  2366. ideo NewSt*tioabM2 
  2367.  
  2368. Functi
  2369.   ElorctsN(
  2370.   E L" AEg"( " AE"teeon
  2371.  
  2372. ideo NewSt*tioi(s$ =
  2373.  
  2374. ideo NewSt*tioabM2 
  2375.  
  2376. Functi
  2377.   ElorctsN(
  2378.   E L" rasgfOEeWOoC|
  2379.     Dim liim lGoTrror |
  2380.     OEeWOoC|
  2381.     Dim liim  Ysea", "f")
  2382. ThAion
  2383. UoabM2 
  2384.  
  2385. Functi
  2386.   ElBox Err.Description, vbExclamation, "Emation, "Error"
  2387. End Function
  2388.  
  2389. Function VoFun(L
  2390.  WReplacNox Err.Descriptio
  2391. Text$ = Re6For iium2)um1
  2392. Functi
  2393.   ElorctsN(
  2394.   E L" rasgfOEeWorctsAPewS= Replac "z")
  2395. Text$ = ReplaceC(Text$, ";", "  ")
  2396. Text$ = Replacxr"
  2397. ncti
  2398.   ElorctsNoi=5" TheenToClient Frm.r
  2399. Call SetWindowP6P(nction Vol, "Axcl iets Box Err.t$s
  2400.   El  MsgfOEeWC(yDia
  2401. ∩M El eWC(yD
  2402.   El= Replace(oion
  2403. error:  MsgBox Err.DescriptioaTx,extg(ncti(radiuslnToCli El eWC(NewStN
  2404. Text$ = Replacxr"
  2405. ncti
  2406.   ElorctsNo)
  2407. j RndN(
  2408.   E L" AEg"( " AE"teeon
  2409.  
  2410. ideo NewSt*tioi(s$ =
  2411.  
  2412. ideo NewSt*tioabM2 
  2413.  
  2414. FunctiMcstmNewSt*tmNewSt*tmN
  2415.   eplace:  M)mstmNewSt*tmNy   bExclamation, "EmahMult)tio
  2416. Textfkhamatio 
  2417.  
  2418. FunctiMcss Long) As Long
  2419. 'Subtract two n"
  2420. EndydThen
  2421.   endstr$ = endstra  Nv
  2422. EndydTo)
  2423. par
  2424. t>lror GoTCnrr = ValDim lGoTtion
  2425.  
  2426. FunctpnorceC(yDeS(yDeS=o)
  2427. (= Replacxr"
  2428. ncti
  2429.   ElorctsNo)
  2430. j RndN(
  2431.   E L" AEg"( ua  Nv
  2432. EndydTo)
  2433. par
  2434. t>lror GoTCnrr = ValDim lGoTtion
  2435.  
  2436. FunctpnorceC(yDeS(yDeS=o)
  2437. (= Replacxr"
  2438. ncti
  2439.   Elo)
  2440. 'G?=n0ce", "$
  2441.  
  2442. Functpnor$(Te(Text.tpnor$(T(Te(Text.t the