more trouble...

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

more trouble...

larry
I have the following code in my app:

repeat for each line thisLine in myTrainingLines
  if the length of thisLine > 5 then
  put thisLine & return after field myTrainingOps
  end if
end repeat
-- filter field myTrainingOps without empty -- WHY IN THE HECK DOESN'T THIS LINE WORK????
delete line 11 of field myTrainingOps  -- SO I HAVE TO USE THIS LINE; BUT I KNOW THERE ARE ONLY SUPPOSED TO BE 10 LINES.  WHAT IF I HAVE A VARYING NUMBER OF LINES???


Again, thanks in advance for the help!
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

Phil Davis-5
Do this:

repeat for each line thisLine in myTrainingLines
     if the length of thisLine > 5 then put thisLine & return after myList
end repeat
delete last char of myList
put myList into field myTrainingOps

Phil Davis



On 4/1/14, 10:32 PM, [hidden email] wrote:

> I have the following code in my app:
>
> repeat for each line thisLine in myTrainingLines
>    if the length of thisLine > 5 then
>    put thisLine & return after field myTrainingOps
>    end if
> end repeat
> -- filter field myTrainingOps without empty -- WHY IN THE HECK DOESN'T THIS LINE WORK????
> delete line 11 of field myTrainingOps  -- SO I HAVE TO USE THIS LINE; BUT I KNOW THERE ARE ONLY SUPPOSED TO BE 10 LINES.  WHAT IF I HAVE A VARYING NUMBER OF LINES???
>
>
> Again, thanks in advance for the help!
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

--
Phil Davis


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

larry
Thanks Phil!

----- Original Message -----
From: "Phil Davis" <[hidden email]>
To: "How to use LiveCode" <[hidden email]>
Sent: Wednesday, April 02, 2014 12:14 AM
Subject: Re: more trouble...


> Do this:
>
> repeat for each line thisLine in myTrainingLines
>     if the length of thisLine > 5 then put thisLine & return after myList
> end repeat
> delete last char of myList
> put myList into field myTrainingOps
>
> Phil Davis
>
>
>
> On 4/1/14, 10:32 PM, [hidden email] wrote:
>> I have the following code in my app:
>>
>> repeat for each line thisLine in myTrainingLines
>>    if the length of thisLine > 5 then
>>    put thisLine & return after field myTrainingOps
>>    end if
>> end repeat
>> -- filter field myTrainingOps without empty -- WHY IN THE HECK DOESN'T
>> THIS LINE WORK????
>> delete line 11 of field myTrainingOps  -- SO I HAVE TO USE THIS LINE; BUT
>> I KNOW THERE ARE ONLY SUPPOSED TO BE 10 LINES.  WHAT IF I HAVE A VARYING
>> NUMBER OF LINES???
>>
>>
>> Again, thanks in advance for the help!
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
> --
> Phil Davis
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode 


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

Dave Kilroy
Quick aside: I'm assuming that use of 'char' (as in "delete the last char of tVar") in the new world of Unicode will still work to get rid of a cr/return/tab - is that others' understanding too?
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

larry
Dave,
I don't know anything about Unicode, but "delete the last char of field
myField" worked just fine in LC

----- Original Message -----
From: "Dave Kilroy" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, April 02, 2014 1:57 AM
Subject: Re: more trouble...


> Quick aside: I'm assuming that use of 'char' (as in "delete the last char
> of
> tVar") in the new world of Unicode will still work to get rid of a
> cr/return/tab - is that others' understanding too?
>
>
>
> -----
> "Some are born coders, some achieve coding, and some have coding thrust
> upon them." - William Shakespeare & Hugh Senior
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/more-trouble-tp4677825p4677833.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode 


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

Dave Kilroy
Hi Larry

Yep I use 'delete the last char of tVar' currently - the thing is can we use in the future? (I'm assuming so) - see this blog for info on LiveCode's upcoming Unicodification http://livecode.com/blog/2014/03/31/examining-unicode-part-i-the-dissection/
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

Dave Kilroy
Just to confirm - it looks like we are safe to continue using the "delete the last char of tList" structure (Fraser just confirmed it in a reply to my question over at http://livecode.com/blog/2014/04/02/examining-unicode-part-ii-digesting-text/ )

I can relax now without that niggling little question buzzing around my head...
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

Richard Gaskin
Dave Kilroy wrote:

 > Just to confirm - it looks like we are safe to continue using the
 > "delete the last char of tList" structure (Fraser just confirmed
 > it in a reply to my question over at
<http://livecode.com/blog/2014/04/02/examining-unicode-part-ii-digesting-text/>
)
 >
 > I can relax now without that niggling little question buzzing around
 > my head...

You should sleep better than ever because now that syntax should work
with all languages, whereas in the past it would have returned only the
last byte of a multi-byte character, giving you linguistic nonsense.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

Dave Kilroy
So now if I cant sleep, instead of counting sheep I'll be counting bytes, codeunits, codepoints, trueWords, segments, sentences and paragraphs :)
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: more trouble...

J. Landman Gay
In reply to this post by larry
On 4/2/14, 12:32 AM, [hidden email] wrote:
> repeat for each line thisLine in myTrainingLines
>    if the length of thisLine > 5 then
>    put thisLine & return after field myTrainingOps
>    end if
> end repeat
> -- filter field myTrainingOps without empty -- WHY IN THE HECK DOESN'T THIS LINE WORK????
> delete line 11 of field myTrainingOps  -- SO I HAVE TO USE THIS LINE; BUT I KNOW THERE ARE ONLY SUPPOSED TO BE 10 LINES.  WHAT IF I HAVE A VARYING NUMBER OF LINES???

The filter command works. If line "11" appears empty, it's probably due
to the carriage return at the end of line 10 that is pushing the cursor
down. To be sure, put this into the message box when you think you see
11 lines:

    put the number of lines in fld "myTrainingOps"

(Note the quotes around the field name. Always quote all literals.)

Do you get 10 or 11?

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode