how read TXT in editText
hi, I try show txt file in editText and it is not works.
I try this:
-----------------
rollout test "test"
(
fn readTXT editTextShow =
(
try
(
local inFolder = getOpenFileName type:"notepad (*.txt)| *.txt "
local inFile = openFile inFolder
editTextShow = inFile
)
catch(false)
)
button testbutton "open"
editText editTextShowBox ""
on testbutton pressed do readTXT editTextShowBox.text
)
-----------------
Comments
how read TXT in editText
hey jmpinero, you should have something like this..
code speaks for itself.
fn readTXT fileName=()
rollout test "test"
(
button testbutton "open"
editText editTextShowBox ""
on testbutton pressed do
(
local inFolder =""
inFolder = getOpenFileName type:"notepad (*.txt)| *.txt "
editTextShowBox.text = readTXT inFolder
)
)
createDialog test
fn readTXT fileName =
(
inText
local inFile = openFile fileName
if inFile != undefined do
(
inText = readLine inFile
)
close inFile
messagebox( inText as string)
return (inText as string)
)
thanks
thanks for your reply
jmpinero3d blog