Re: How to store some data in my stack
On Jan 27, 2012, at 1:57 AM, Takashi Yoshino wrote: > Hi, Ken > >> Are you *really* using curly quotes around "documents" and "testFile.txt"? >> The only reason I ask is that you have straight quotes around "Data" and "no >> file yet!", so I figured I'd check. If so, that might be the problem >> (although I'd think you'd get an error dialog first, but)… > > Thank you for you help. > The problem was resolved for your comment. > > Quote is bad effect, but no error messages…. Wow… that's one for the books! Odd that it didn't give any error messages, but I'm glad it worked! Ken Ray Sons of Thunder Software, Inc. Email: k...@sonsothunder.com Web Site: http://www.sonsothunder.com/ ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
Hi, Ken > Are you *really* using curly quotes around "documents" and "testFile.txt"? > The only reason I ask is that you have straight quotes around "Data" and "no > file yet!", so I figured I'd check. If so, that might be the problem > (although I'd think you'd get an error dialog first, but)… Thank you for you help. The problem was resolved for your comment. Quote is bad effect, but no error messages…. Thanks so much. -- Write button on mouseUp put fld "Data" into URL("file:" & specialFolderPath(documents) & SLASH & testFile.txt) end mouseUp -- Read button on mouseUp put URL("file:" & specialFolderPath(documents) & SLASH & testFile.txt) into fld "Data" end mouseUp But Japanese Text does not write correctly both Mac and Android... _.__ ._ _. ._ ._.__ .. ._._. _._ . ..__ ._.__ ._._. ___. .._ __.. __ .._ Takashi Yoshino http://www.wakayama-u.ac.jp/~yoshino/lab/ Tel: +81-73-457-8441 On 2012/01/27, at 2:36, Ken Ray wrote: > > On Jan 25, 2012, at 10:55 PM, J. Landman Gay wrote: > put specialFolderPath(“documents”)& "/"& “testFile.txt” into tFile if there is a file tFile then put URL("file:"& tFile) into fld "Data" put the result into fld "msg" else answer "No file yet!" end if end mouseUp >>> >>> "no file yet!" is shown in an android. >>> >>> 'Write' function can't work, that is, >>> put fld "Data" into URL("file:"& specialFolderPath(“documents”)& "/"& >>> “testFile.txt”) >>> is not working on an android. > > Are you *really* using curly quotes around "documents" and "testFile.txt"? > The only reason I ask is that you have straight quotes around "Data" and "no > file yet!", so I figured I'd check. If so, that might be the problem > (although I'd think you'd get an error dialog first, but)… > > Ken Ray > Sons of Thunder Software, Inc. > Email: k...@sonsothunder.com > Web Site: http://www.sonsothunder.com/ > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
On Jan 25, 2012, at 10:55 PM, J. Landman Gay wrote: >>> put specialFolderPath(“documents”)& "/"& “testFile.txt” into tFile >>> if there is a file tFile then >>>put URL("file:"& tFile) into fld "Data" >>>put the result into fld "msg" >>> else >>> answer "No file yet!" >>> end if >>> end mouseUp >> >> "no file yet!" is shown in an android. >> >> 'Write' function can't work, that is, >> put fld "Data" into URL("file:"& specialFolderPath(“documents”)& "/"& >> “testFile.txt”) >> is not working on an android. Are you *really* using curly quotes around "documents" and "testFile.txt"? The only reason I ask is that you have straight quotes around "Data" and "no file yet!", so I figured I'd check. If so, that might be the problem (although I'd think you'd get an error dialog first, but)… Ken Ray Sons of Thunder Software, Inc. Email: k...@sonsothunder.com Web Site: http://www.sonsothunder.com/ ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
>> >> Did someone succeed in writing a file on android? > > I have done it. I'm not sure why your code doesn't work, it's very much like > mine. Did you write a file first before you tried to read it? Yes. I wrote a file first, then read it. I give up this problem... _.__ ._ _. ._ ._.__ .. ._._. _._ . ..__ ._.__ ._._. ___. .._ __.. __ .._ Takashi Yoshino http://www.wakayama-u.ac.jp/~yoshino/lab/ Tel: +81-73-457-8441 On 2012/01/26, at 13:55, J. Landman Gay wrote: > On 1/25/12 6:05 PM, Takashi Yoshino wrote: >>> - Read button >>> on mouseUp >>> put specialFolderPath(“documents”)& "/"& “testFile.txt” into tFile >>> if there is a file tFile then >>>put URL("file:"& tFile) into fld "Data" >>>put the result into fld "msg" >>> else >>> answer "No file yet!" >>> end if >>> end mouseUp >> >> "no file yet!" is shown in an android. >> >> 'Write' function can't work, that is, >> put fld "Data" into URL("file:"& specialFolderPath(“documents”)& "/"& >> “testFile.txt”) >> is not working on an android. >> >> Did someone succeed in writing a file on android? > > I have done it. I'm not sure why your code doesn't work, it's very much like > mine. Did you write a file first before you tried to read it? > > -- > Jacqueline Landman Gay | jac...@hyperactivesw.com > HyperActive Software | http://www.hyperactivesw.com > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
On 1/25/12 6:05 PM, Takashi Yoshino wrote: - Read button on mouseUp put specialFolderPath(“documents”)& "/"& “testFile.txt” into tFile if there is a file tFile then put URL("file:"& tFile) into fld "Data" put the result into fld "msg" else answer "No file yet!" end if end mouseUp "no file yet!" is shown in an android. 'Write' function can't work, that is, put fld "Data" into URL("file:"& specialFolderPath(“documents”)& "/"& “testFile.txt”) is not working on an android. Did someone succeed in writing a file on android? I have done it. I'm not sure why your code doesn't work, it's very much like mine. Did you write a file first before you tried to read it? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
Hi, Klaus Thank you for your help! > - Read button > on mouseUp > put specialFolderPath(“documents”) & "/" & “testFile.txt” into tFile > if there is a file tFile then >put URL("file:" & tFile) into fld "Data" >put the result into fld "msg" > else > answer "No file yet!" > end if > end mouseUp "no file yet!" is shown in an android. 'Write' function can't work, that is, put fld "Data" into URL("file:" & specialFolderPath(“documents”) & "/" & “testFile.txt”) is not working on an android. Did someone succeed in writing a file on android? I tried rev online user sample. Android-> List Files and Folders 2. On an android, list files work well, but write files did not work… _.__ ._ _. ._ ._.__ .. ._._. _._ . ..__ ._.__ ._._. ___. .._ __.. __ .._ Takashi Yoshino http://www.wakayama-u.ac.jp/~yoshino/lab/ Tel: +81-73-457-8441 On 2012/01/26, at 1:04, Klaus on-rev wrote: > Hi Takashi, > > Am 25.01.2012 um 16:56 schrieb 吉野 孝: > >> Hi, Klaus >> >> Thank you for your quick reply! >> >> I changed my script, but it does not work on an android. >> (It does work on my mac.) >> >> The following are the test script. >> (URL is very easy! thanks) >> >> - Write button >> on mouseUp >> put fld "Data" into URL("file:" & specialFolderPath(“documents”) & "/" & >> “testFile.txt”) >> put the result into fld "msg" >> end mouseUp > > What is "the result" here? > >> - Read button >> on mouseUp >> put URL("file:" & specialFolderPath(“documents”) & "/" & “testFile.txt”) >> into fld "Data" >> put the result into fld "msg" >> end mouseUp >> # "/" -> ":"(mac) >> On my mac, those scripts work well. >> >> But, on my android, "can't open file" is shown in field "msg" > > Sorry, have no android license, no idea what's going wrong here. > > Maybe you should check first, if the file exists? > > - Read button > on mouseUp > put specialFolderPath(“documents”) & "/" & “testFile.txt” into tFile > if there is a file tFile then >put URL("file:" & tFile) into fld "Data" >put the result into fld "msg" > else > answer "No file yet!" > end if > end mouseUp > > > > > Best > > Klaus > > -- > Klaus Major > http://www.major-k.de > kl...@major.on-rev.com > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
They all look good to me. Something must have converted them. Bob On Jan 25, 2012, at 10:39 AM, Robert Brenstein wrote: > Hi Takashi, > >> put fld "Data" into URL("file:" & specialFolderPath("documents") & "/" & >> "testFile.txt") > > I notice that you have two different kinds of quotes in the above. If that is > your actual code, those non-programmer's quote might be the problem. > > robert > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
Hi Takashi, put fld "Data" into URL("file:" & specialFolderPath("documents") & "/" & "testFile.txt") I notice that you have two different kinds of quotes in the above. If that is your actual code, those non-programmer's quote might be the problem. robert ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
Hi Takashi, Am 25.01.2012 um 16:56 schrieb 吉野 孝: > Hi, Klaus > > Thank you for your quick reply! > > I changed my script, but it does not work on an android. > (It does work on my mac.) > > The following are the test script. > (URL is very easy! thanks) > > - Write button > on mouseUp > put fld "Data" into URL("file:" & specialFolderPath(“documents”) & "/" & > “testFile.txt”) > put the result into fld "msg" > end mouseUp What is "the result" here? > - Read button > on mouseUp > put URL("file:" & specialFolderPath(“documents”) & "/" & “testFile.txt”) > into fld "Data" > put the result into fld "msg" > end mouseUp > # "/" -> ":"(mac) > On my mac, those scripts work well. > > But, on my android, "can't open file" is shown in field "msg" Sorry, have no android license, no idea what's going wrong here. Maybe you should check first, if the file exists? - Read button on mouseUp put specialFolderPath(“documents”) & "/" & “testFile.txt” into tFile if there is a file tFile then put URL("file:" & tFile) into fld "Data" put the result into fld "msg" else answer "No file yet!" end if end mouseUp Best Klaus -- Klaus Major http://www.major-k.de kl...@major.on-rev.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
Hi, Klaus Thank you for your quick reply! I changed my script, but it does not work on an android. (It does work on my mac.) The following are the test script. (URL is very easy! thanks) - Write button on mouseUp put fld "Data" into URL("file:" & specialFolderPath(“documents”) & "/" & “testFile.txt”) put the result into fld "msg" end mouseUp - Read button on mouseUp put URL("file:" & specialFolderPath(“documents”) & "/" & “testFile.txt”) into fld "Data" put the result into fld "msg" end mouseUp # "/" -> ":"(mac) On my mac, those scripts work well. But, on my android, "can't open file" is shown in field "msg" On 2012/01/26, at 0:33, Klaus on-rev wrote: > Konichi-wa Takashi, > > Am 25.01.2012 um 16:19 schrieb 吉野 孝: > >> Hi, >> >> I use LiveCode 5.0.2 for Android devices. >> >> I would like to store some data in my stack. >> But I don't know how to store some data in my stack on an android device. >> >> At first, I used a field. But the field data is gone at the next launches. >> >> Next, I tried to use file. >> The following are the test scripts. >> >> This is the 'write file' script. >> on mouseUp > > ## : is the Mac specific path delimiter, and will obviously work on a Mac but > nowhere else ;-) > > ## So ALWAYS use the SLASH as pathdelimiter on ALL platforms: >> ## put specialFolderPath(“documents”) & ":" & “testFile.txt” into fileName > put specialFolderPath(“documents”) & "/" & “testFile.txt” into fileName >> open file fileName >> write fld "Data" to file fileName > > ## If you do not psecify a TARGET (like a filed) for the PUT, > ## the output will go into the message box > ## which is not available on ANDROID and iOS! >> put the result >> close file fileName >> end mouseUp >> >> This is the 'read file' script >> on mouseUp > > ## Same here, will work with a SLASH! >> put specialFolderPath(“documents”) & "/" & “testFile.txt” into fileName >> open file fileName >> read from file fileName until EOF >> put it into fld "Data" >> close file fileName >> end mouseUp >> >> The scripts work on my Mac. >> But they does not work on an Android device. > > See above for the explanation :-) > > Hint: you can save some typing by using the short URL syntax (a one-liner): > ... > put URL("file:" & specialFolderPath(“documents”) & "/" & “testFile.txt”) into > fld "Data" > ... > > Check URL in the dictionary! > >> I need your help. > > Now you got it :-) > >> _.__ ._ _. ._ ._.__ .. ._._. _._ . ..__ ._.__ ._._. ___. .._ __.. __ .._ >> Takashi Yoshino > > Best > > Klaus > > -- > Klaus Major > http://www.major-k.de > kl...@major.on-rev.com > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _.__ ._ _. ._ ._.__ .. ._._. _._ . ..__ ._.__ ._._. ___. .._ __.. __ .._ Takashi Yoshino http://www.wakayama-u.ac.jp/~yoshino/lab/ Tel: +81-73-457-8441 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to store some data in my stack
Konichi-wa Takashi, Am 25.01.2012 um 16:19 schrieb 吉野 孝: > Hi, > > I use LiveCode 5.0.2 for Android devices. > > I would like to store some data in my stack. > But I don't know how to store some data in my stack on an android device. > > At first, I used a field. But the field data is gone at the next launches. > > Next, I tried to use file. > The following are the test scripts. > > This is the 'write file' script. > on mouseUp ## : is the Mac specific path delimiter, and will obviously work on a Mac but nowhere else ;-) ## So ALWAYS use the SLASH as pathdelimiter on ALL platforms: > ## put specialFolderPath(“documents”) & ":" & “testFile.txt” into fileName put specialFolderPath(“documents”) & "/" & “testFile.txt” into fileName >open file fileName > write fld "Data" to file fileName ## If you do not psecify a TARGET (like a filed) for the PUT, ## the output will go into the message box ## which is not available on ANDROID and iOS! > put the result > close file fileName > end mouseUp > > This is the 'read file' script > on mouseUp ## Same here, will work with a SLASH! > put specialFolderPath(“documents”) & "/" & “testFile.txt” into fileName > open file fileName > read from file fileName until EOF > put it into fld "Data" > close file fileName > end mouseUp > > The scripts work on my Mac. > But they does not work on an Android device. See above for the explanation :-) Hint: you can save some typing by using the short URL syntax (a one-liner): ... put URL("file:" & specialFolderPath(“documents”) & "/" & “testFile.txt”) into fld "Data" ... Check URL in the dictionary! > I need your help. Now you got it :-) > _.__ ._ _. ._ ._.__ .. ._._. _._ . ..__ ._.__ ._._. ___. .._ __.. __ .._ > Takashi Yoshino Best Klaus -- Klaus Major http://www.major-k.de kl...@major.on-rev.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode