home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / LANG20.ZIP / PROGRAM.BAS < prev    next >
BASIC Source File  |  1993-11-08  |  1KB  |  49 lines

  1.  
  2. DEFINT A-Z
  3.  
  4. DIM SHARED File_LNG%        ' Filehandle of Language-file
  5.  
  6. DECLARE SUB StartLNG ()
  7. DECLARE FUNCTION Message$ (BYVAL Index&)
  8.  
  9. FUNCTION Message$ (BYVAL Index&)
  10.  
  11.     IF Index& > 5 THEN
  12.         GET File_LNG%, (Index& * 4) + 401, xpos&      ' get position of string
  13.         GET File_LNG%, xpos&, x%                      ' get length of string
  14.     ELSE
  15.         x% = 78
  16.         xpos& = (Index& - 1) * 80 - 1
  17.     END IF
  18.  
  19.     a$ = SPACE$(x%)
  20.     GET File_LNG%, xpos& + 2, a$                  ' and read the string
  21.     
  22.     IF Index& > 5 THEN
  23.         ' ┼┼┼
  24.         ' here you must de-encrypt the string, if you did encrypt it in
  25.         ' FORM1:OptimizeFile_Click
  26.     END IF
  27.  
  28.     Message$ = LTRIM$(RTRIM$(a$))
  29.  
  30. END FUNCTION
  31.  
  32. SUB StartLNG ()
  33.  
  34.     Name_LNG$ = "filename.lng"          ' change this to your filename,
  35.                                         ' in my apps. Name_LNG$ is common
  36.                                         ' shared, so I can change it at runtime
  37.  
  38.     IF DIR$(Name_LNG$) <> "" THEN
  39.         File_LNG% = FREEFILE
  40.         OPEN Name_LNG$ FOR BINARY AS File_LNG%
  41.     ELSE
  42.         BEEP
  43.         MSGBOX "Error with languagefile"
  44.         END
  45.     END IF
  46.  
  47. END SUB
  48.  
  49.