home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / QM95REAL.ZIP / SCRIPTS.Z / HOSTUTIL.QSC < prev    next >
Text File  |  1995-08-24  |  2KB  |  55 lines

  1. ' Utility routines for host mode.
  2. '
  3. ' DO NOT COMPILE THIS FILE BY ITSELF!
  4. '
  5. ' This file is a part of the complete HOST.QSC and will not compile
  6. ' alone.  To recompile the host scripts, select Scripts/Compile from
  7. ' the QmodemPro for Windows menu and select HOST.QSC in the "Compile
  8. ' script" dialog box.  This file will automatically be compiled as
  9. ' part of the full script.
  10.  
  11. const SecondsInDay = 86400
  12.  
  13. declare sub OemToChar lib "user32" alias "OemToCharA" (src as string, dest as string)
  14. declare sub CharToOem lib "user32" alias "CharToOemA" (src as string, dest as string)
  15. declare function CharUpper lib "user32" alias "CharUpperA" (s as string) as string
  16.  
  17. function FindLastBackslash(byval fn as string)
  18.   dim i as integer
  19.   i = len(fn)
  20.   do while i > 0 and fn(i) <> "\" and fn(i) <> ":"
  21.     i = i - 1
  22.   loop
  23.   FindLastBackslash = i
  24. end function
  25.  
  26. function JustPathName(byval pathname as string) as string
  27.   dim i as integer
  28.   i = FindLastBackslash(pathname)
  29.   JustPathName = left(pathname, i)
  30. end function
  31.  
  32. function JustFilename(byval pathname as string) as string
  33.   dim i as integer
  34.   i = FindLastBackslash(pathname)
  35.   JustFileName = mid(pathname, i+1)
  36. end function
  37.  
  38. function AddBackSlash(byval dirname as string) as string
  39.   dim i as integer
  40.   i = len(dirname)
  41.   if dirname(i) <> "\" then
  42.     dirname = dirname + "\"
  43.   end if
  44.   AddBackSlash = dirname
  45. end function
  46.  
  47. function OemUpper(byval s as string) as string
  48.   dim buf as string
  49.   buf = space(len(s))
  50.   call OemToChar(s, buf)
  51.   call CharUpper(buf)
  52.   call CharToOem(buf, buf)
  53.   OemUpper = buf
  54. end function
  55.