B4A Question Explaining text files - ilan (first post)    Mar 20, 2021   (1 reaction) maybe something like this:
File.WriteString(File.DirApp,"test.txt","this is the first line")
'....'
Dim sb As StringBuilder
sb.Initialize
sb.Append(File.ReadString(File.DirApp,"test.txt")).Append(CRLF).Append("this is the second line")
File.WriteString(File.DirApp,"t B4i Question files internal ios - aminoacid (first post)    Sep 15, 2022   (1 reaction) I suggest using "xui.DefaultFolder" and File.ReadString, File.WriteString, etc. especially if you are writing a cross-platform application. Example: xui.SetDataFolder("YourFolderName") File.WriteString(xui.DefaultFolder,"filename","string") B4A Question Saving a variable in memory - inakigarm (first post)    Sep 28, 2016   (2 reactions) Most simplest example: (from B4A IDE info) Write it: File.WriteString(File.DirRootExternal, "1.txt", "Some text") Read it: Dim text As String text = File.ReadString(File.DirRootExternal, "1.txt") See File object for more options B4A Library [B4X] CSVParser - CSV parser and generator - Erel    Jun 29, 2020   (33 reactions) CSV - comma separated values format. The various StringUtils libraries include methods for loading and saving CSV files. However these methods have a few drawbacks: - They work with files instead of strings. This is especially problematic if the input is not UTF8 encoded. - As they are implemente B4A Question {Closed] GetBytes problem - Erel (first post)    Aug 11, 2021   (1 reaction) String.GetBytes -> returns the bytes representing the string. File.ReadBytes -> reads the file and return its raw content. Practically: File.WriteString(s) 'same as File.WriteBytes(s.GetBytes("utf8")) Dim b() As Byte = s.GetBytes("utf8") 'same as b = File.ReadBytes("file that we previously wrote" B4A Question Can i execute adb commands via B4A? - Alhootti (first post)    Sep 19, 2024 Thanks @Erel
it is working now perfectly
File.WriteString(File.DirInternalCache, "command", "modprobe cifs" & CRLF & "modprobe aufs" & CRLF & "date 102902012020.55" & CRLF & "exit") 'Any commands via crlf, and exit at end B4A Tutorial Uncaught Exceptions - Erel (first post)    Apr 24, 2017   (3 reactions) File.WriteString overwrites the existing file. It doesn't append anything.
If you want to append then open an OutputStream with Append parameter set to True and then use TextWriter to write the data. Don't forget to close it. B4A Question Port number 20 or 21 for successful Upload to FTP server - KMatle (first post)    Nov 18, 2016   (1 reaction) File.WriteString(File.DirRootExternal
If File.Exists(File.DirRootExternal...
vs.
ibFTP.UploadFile(File.DirDefaultExternal
It's not the same directoy! B4A Question How can to set the date and time the Android system? - rtek1000 (first post)    Sep 18, 2015   (2 reactions) Combine(File.DirInternalCache, "command") File.WriteString(File.DirInternalCache, "runner", "su < " & Command) File.WriteString(File.DirInternalCache, "command", Command_in & CRLF & "exit") 'Any commands via crlf, and exit at end StdOut.Initialize StdErr.Initialize Result B4A Question File.WriteString Problem - wdegler    Mar 10, 2016 To anyone with an explanation:
I clicked on Help/Online Help, selected File/WriteString and copied the example:
File.WriteString(File.DirRootExternal, "1.txt", "Some text")
into a program as the first statement after the LoadLayout line.
I then set a breakpoint on the line after that. After Page: 1   2   3   4   5   6   7   Powered by ColBERT |