R
romanko
Подскажите как очистить содержимое файла и загрузить из переменной в него данные. Или как заменить содержимое файла на содержимое переменной?
Вот делаю вот такromanko
Я уже узнаю тебя по постановке вопроса![]()
Вот делаю вот так
Open filepath For Output Access Write _
As fileNum
Открываю фал на запись. а как в него внести данные?Хотя бы в какую сторону рыть?
Dim fileNum As Integer, empNumber As Integer, I As Integer
Dim fileName As String, empName As String
Dim empLocation As Variant
Dim empSalary As Currency
fileNum% = FreeFile()
fileName$ = "data.txt"
' Write out some employee data.
Open fileName$ For Output As fileNum%
Write #fileNum%, "Joe Smith", 123, "1 Rogers Street", _
25000.99
Write #fileNum%, "Jane Doe", 456, "Two Cambridge Center", _
98525.66
Write #fileNum%, "Jack Jones", 789, "Fourth Floor", 0
Close fileNum%
' Read it all back and print it.
Open fileName$ For Input As fileNum%
For I% = 1 To 3
Input #fileNum%, empName$, empNumber%, empLocation, _
empSalary@
Print empName$, empNumber%, empLocation, empSalary@
Next I%
Close fileNum%
' Output:
' LotusScript prints out the contents of the file
' C:\data.txt in groups of four values each. Each group
' consists of a String, an Integer, a Variant, and
' a Currency value, in that order.
И еще когда вот так
Open fileName$ For Output As fileNum
Write #fileNum, Tmp1
записуешь в файл он создает его во временной папке как указать путь для создания файла??
Взломай свой первый сервер и прокачай скилл — Начни игру на HackerLab