Reading From File

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Reading From File

Post by warrenk » Thu Oct 16, 2008 8:56 pm

I am reading data from a file which uses '*' as a separator between fields. When I put 'it' into my field, it includes my separator. How would I prevent the separator from being added.

Data:
12345*6789*

read from file "settings.dat" until "*"
put it into field "Total1"

value of Total1 is 12345*. I require the value to be 12345.

Thanks!
Warren

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Oct 16, 2008 9:18 pm

Simply add the following after your 'read' command.

Code: Select all

delete char -1 of it
HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply