I have file named MYFILE.TXT already created in the folder where sits my application (they both are i in the same folder, the same level, no subfolders).
I need to insert a code into my program, which existing content of MYFILE.TXT will replace by a content of string named MYSTRING. Basicaly if MYSTRING=“123456” then MYFILE.TXT will be rewritten and will contain “123456”. NO DIALOG WINDOW needed. The length of MYSTRING will be less than 2000 characters.
Also I need the same but other way round: The content from existing MYFILE.TXT to put into MYSTRING. NO DIALOG WINDOW.
Please give me an exact code for OS X with all definitions/declarations which I can simply copy and paste into my code.
Please detail exactly what procedures you have tried, why you think what you tried should work, what error message what you tried produced and provide the code that you came up with.
Once you have made an appropriate attempt at doing the research youself, and proven that you are willing to do what is required to be a developer, then we will help you with specific issues that arise from your misunderstanding of concepts or procedures as shown in the code you provided.
But the purpose of this forum is to share and educate each other, not to provide design and coding services on demand. And perhaps it is a language barrier, but to be “Please give me” doesn’t show any initiative.
Show us that you tried, and we will be more than glad to help
Dim f As FolderItem
Dim dd As String
Dim t As TextInputStream
Dim MYSTRING as String
f=GetFolderItem("").Parent.Child("Sqlite.txt")
If f <> Nil then
t=TextInputStream.Open(f)
t.Encoding=Encodings.UTF8
dd=t.ReadLine
If dd.len > 10 Then
MYSTRING=dd
end If
End if
I didn’t mean to ask something arrogantly. I just wanted to write my question in the way so everybody understand what I need to help with (at least I tried). I’m new in xojo and in programming like that. If you call it “make a code for me…”? OK. But I really needed to help as I asked for.
Vlad
Hm… Not the best way to introduce yourself to Xojo community. But, hey, you are not the first one… just try to ask things in a different way and you will find a lot of people willing to help you.
Vlad,
I highly recommend going through the Introduction .pdf at: https://www.xojo.com/learn/
Maybe it will take you 2 or 3 days but it’s fun and a very good investment if you’re serious with Xojo.