The place to discuss anything and everything about running your LiveCode on Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
Googie85
- Posts: 227
- Joined: Tue Aug 05, 2014 10:07 am
Post
by Googie85 » Mon May 07, 2018 7:25 am
Hi Guys,
I know this is a simple question but I am unable to find an answer to it. My line of code is below:
Code: Select all
replace line 3 to line 4 of URL ("binfile:/mnt/sdcard/Temp.van") with ""
Any Help?
Many Thanks,
Googie.
-
SparkOut
- Posts: 2947
- Joined: Sun Sep 23, 2007 4:58 pm
Post
by SparkOut » Mon May 07, 2018 9:12 am
How would you determine what constitutes a "line" of binary data?
Is it possible to use a text file for which there are designated line endings? Or else, you will have to define markers in the binary data to be able to manipulate the sections you want (even if that is just counting the bytes).
Also try the syntax:
Code: Select all
put empty into line 3 to 4 of url ("file:" & theFilePath)
this assumes you are not using a binary file without "lines"
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Mon May 07, 2018 9:20 am
That statement reads a file from disk, gets a segment of it, and then does nothing.
If you want to change the file on disk you'll need to write to it too.
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Mon May 07, 2018 8:23 pm
FourthWorld wrote: ↑Mon May 07, 2018 9:20 am
That statement reads a file from disk, gets a segment of it, and then does nothing.
If you want to change the file on disk you'll need to write to it too.
Not sure which statement you mean, but this one does the whole job:
Code: Select all
put empty into line 3 to 4 of url ("file:" & theFilePath)
URLs act as containers, so the read/write sequence completes.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Mon May 07, 2018 8:29 pm
jacque wrote: ↑Mon May 07, 2018 8:23 pm
FourthWorld wrote: ↑Mon May 07, 2018 9:20 am
That statement reads a file from disk, gets a segment of it, and then does nothing.
If you want to change the file on disk you'll need to write to it too.
Not sure which statement you mean, but this one does the whole job:
Code: Select all
put empty into line 3 to 4 of url ("file:" & theFilePath)
URLs act as containers, so the read/write sequence completes.
Thanks. In retrospect, I can see I was distracted by a related question elsewhere.
Then what was the issue here?
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Mon May 07, 2018 9:32 pm
Then what was the issue here?
I'm not quite sure, the actual problem wasn't defined. The issue of line endings is relevant, as well as alternate syntax for emptying lines, but it isn't clear what exactly went wrong in the original post.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
bwmilby
- Posts: 463
- Joined: Wed Jun 07, 2017 5:37 am
-
Contact:
Post
by bwmilby » Tue May 08, 2018 12:47 am
If you are on a Mac, you may get unintended effects using file. LC still thinks we are using legacy Macs with CR line endings. I write everything using binfile to avoid that issue. Using file will leave you with CR line endings. Using binfile will leave you with LF line endings.