Hi,
I'm very *very* new to livecode, so this may be a dumb question, but I'm having trouble with lineoffsets. I have a list of items in one variable, with one line set as a sort of break point to separate 2 sets of data. I want to use lineoffset to break up the data. So, I'm trying to put line 1 of said variable through lineoffset-1 into one variable, and lineoffset + 1 through the last line into a different variable.
Is this something I can do? If so, how?
Thanks so much!
Lineoffset list
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Lineoffset list
Hi laurpapo
1. welcome to the forum
2. Plaese check these stacks:
http://www.runrev.com/developers/lesson ... nferences/
3. Did you check "lineoffset" in the dictionary?
"lineoffset" will return the NUMBER of the line, if found, or 0, if not
What is in the "one line set as a sort of break point"?
This is the most important info!
Best
Klaus
1. welcome to the forum

2. Plaese check these stacks:
http://www.runrev.com/developers/lesson ... nferences/
3. Did you check "lineoffset" in the dictionary?

"lineoffset" will return the NUMBER of the line, if found, or 0, if not
What is in the "one line set as a sort of break point"?
This is the most important info!
Best
Klaus
Re: Lineoffset list
Something like that
Let's assume MyText contains 3 lines :
my first data set
*BREAK*
my second data set
Let's assume MyText contains 3 lines :
my first data set
*BREAK*
my second data set
Code: Select all
set the wholeMatches to true
put "*BREAK*" into myBreakPoint
put lineoffset (myBreakpoint,myText) into myResult --will contain the number of the found line, or 0
if myResult >0 then
put line (myResult-1) of myText into myDataSet1
put line (myResult+1) of myText into myDataSet2
else
answer "Not found"
end if
Re: Lineoffset list
Thank you both for your help! As it turns out, I was just messing up on syntax.
My bad...
-Thanks!
My bad...

-Thanks!