home *** CD-ROM | disk | FTP | other *** search
-
- DEFINT A-Z
- '$INCLUDE: 'lang.bi'
- '$INCLUDE: 'cmndlg.bi'
-
- '$FORM form1
-
- DECLARE FUNCTION Message$ (BYVAL index&)
- DECLARE FUNCTION Readstr$ (index&, fil%)
- DECLARE SUB main ()
-
- main
-
- REM $DYNAMIC
- SUB AddStr (s$, index&, fil%, BeginStr&)
-
- ' ----------------------------------------------------
- ' This part I got from Karl W. Stembol, on the CompuServe MSBASIC-forum
- ' I just changed it a little.
- ' Thanks!
- ' ----------------------------------------------------
-
- IF BeginStr& = 0 THEN BeginStr& = 16004
-
- IF index& = 0 THEN
- GET fil%, 401, numstr& ' get current last string
- IF EOF(fil%) THEN
- numstr& = 1: xpos& = BeginStr& ' new file, this is first string
- ELSE
- numstr& = numstr& + 1: xpos& = LOF(fil%) + 1
- END IF
- x% = LEN(s$)
- PUT fil%, xpos&, x% ' put length
- PUT fil%, , s$ ' and then the data
- PUT fil%, 401, numstr& ' update number of strings
- PUT fil%, (numstr& * 4) + 401, xpos& ' and position of this string
- index& = numstr&
- ELSE
- GET fil%, 401, numstr& ' get current last string
-
- IF EOF(fil%) THEN
- numstr& = 1
- xpos& = BeginStr& ' new file, this is first string
- ELSE
- IF index& > numstr& THEN
- numstr& = index&
- END IF
- xpos& = LOF(fil%) + 1
- END IF
-
- x% = LEN(s$)
- PUT fil%, xpos&, x% ' put length
- PUT fil%, xpos& + 2, s$ ' and then the data
- PUT fil%, (index& * 4) + 401, xpos& ' and position of this string
- PUT fil%, 401, numstr& ' update number of strings
-
- END IF
-
- END SUB
-
- SUB main ()
-
- COLOR 14, 0
- CLS
- PRINT "Language 2.00"
- PRINT "CC Advies - PO Box 351 - 3940 AJ Doorn, the Netherlands"
- COLOR 7, 0
- PRINT STRING$(80, 250)
- PRINT "Taco Oosterkamp CompuServe ID 100117,2545 "
- PRINT "Public Domain"
- PRINT "WITH LOT OF THANKS to Karl W. Stembol for the main-routine."
- PRINT
-
- Screen.Controlpanel(7) = 0
-
- FileSave FilNam$, Pad$, "*.LNO", "FileName", 0, 7, 0, Cancel
- IF Cancel <> 0 THEN
- END
- END IF
-
- Lang_Bestand$ = Pad$ + "\" + FilNam$
- Lang_BestandLeft$ = LEFT$(Lang_Bestand$, INSTR(Lang_Bestand$, ".") - 1)
-
- f% = FREEFILE
- OPEN Lang_Bestand$ FOR BINARY AS f%
-
- form1.SHOW
-
- END SUB
-
- FUNCTION Readstr$ (index&, fil%)
-
- ' ----------------------------------------------------
- ' This part I got from Karl W. Stembol, on the CompuServe MSBASIC-forum
- ' Thanks!
- ' ----------------------------------------------------
-
- GET fil%, (index& * 4) + 401, xpos& ' get position of string
- GET fil%, xpos&, x% ' get length of string
- Readstr$ = SPACE$(x%)
- GET fil%, , Readstr$ ' and read the string
-
- END FUNCTION
-
-