Script problem

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

Script problem

charles61
I am using the following script to retrieve the labels of checked checkboxes on marked cards and put them in the field "recommendations". The labels are custom properties (uMyLabel).  The script works fine but I am getting five blank lines in recommendations field before the first checkbox label is inserted in the field.  

Any suggestions?

on mouseUp
   
   repeat with y = 1 to the number of cards of stack "MyStack"
      if the mark of card y of stack "MyStack"= true then
         put the number of buttons of card y of stack "MyStack"into nbr
         repeat with n = 1 to nbr
            if the style of button n of card y of stack "MyStack" is "checkbox"\
                  and the hilite of button n of card y of stack "MyStack" is true then
               put the uMyLabel of button n of card y of stack "MyStack" into tName
               put tName & cr after theList
            end if
         end repeat
      end if
   end repeat

  delete char -1 of theList
  put theList into field "recommendations"
Reply | Threaded
Open this post in threaded view
|

Re: Script problem

Thierry Douez
2012/10/24 charles61 <[hidden email]>:
> I am using the following script to retrieve the labels of checked checkboxes
> on marked cards and put them in the field "recommendations". The labels are
> custom properties (uMyLabel).  The script works fine but I am getting five
> blank lines in recommendations field before the first checkbox label is
> inserted in the field.
>
> Any suggestions?


Ok, I try one :)

I'm guessing that you have a card which is marked , contains 5 checkbox buttons
with no customproperty uMyLabel !

Check this by inserting another line:

> on mouseUp
>
>    repeat with y = 1 to the number of cards of stack "MyStack"
>       if the mark of card y of stack "MyStack"= true then
>          put the number of buttons of card y of stack "MyStack"into nbr
>          repeat with n = 1 to nbr
>             if the style of button n of card y of stack "MyStack" is
> "checkbox"\
>                   and the hilite of button n of card y of stack "MyStack"   then

   *******  if  the uMyLabel of button n of card y of stack "MyStack"
is empty then
                     put y &&  n
                end if

>                put the uMyLabel of button n of card y of stack "MyStack" iinto tName
>                put tName & cr after theList
>             end if
>          end repeat
>       end if
>    end repeat
>

_______________________________________________
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: Script problem

charles61
Hi Therry!

I tried your script suggestion. It reported card 32 and button 38. When I checked this information, there were no checkbox buttons that have custom properties on this card.

I went through my project and checked all of the some 700+ checkboxes and did not find any checkboxes that had the uMyLabel custom property and no custom property label.

I did find two fields that have an uMyLabel, which they shouldn't have and removed the custom properties for them. But I am still getting the five blank lines in my recommendation field. I should have mentioned that the recommendation field is a scrolling field. I have tried my code in a smaller sample stack with a scrolling field but did not have the 5 blank fields. I checked and found both scrolling fields have the same settings. Nevertheless, I tried various combinations of property settings, including the new Layer Mode with no success. I also found an old group script on one of my cards and removed it but still no success.

I am use the find function in LC but still have not found the problem. Any other suggestions?
Reply | Threaded
Open this post in threaded view
|

Re: Script problem

Ben Rubinstein
On 24/10/2012 21:26, charles61 wrote:
> I tried your script suggestion. It reported card 32 and button 38. When I
> checked this information, there were no checkbox buttons that have custom
> properties on this card.
>
> I went through my project and checked all of the some 700+ checkboxes and
> did not find any checkboxes that had the uMyLabel custom property and no
> custom property label.

Note that LiveCode makes no distinction between an object having a custom
property with an empty string, and an object that doesn't have that custom
property.

If you ask for the uIjustMadeItUp of any object, the value will be the same
empty string as it would be if there was a custom property of that name.
(There is a way of testing whether the custom property actually exists, but
it's convoluted.)

So like Thierry I suspect the problem is that you have five checkboxes - which
might be on one card or five cards - that have no uMyLabel property or a
uMyLabel property with empty value.

Thierry's script suggestion had the problem that it will only show you the
last found one (because each "put" overwrites the previous).  So if you want
to find them - ie if you don't think you should have any - then you could make
this variation, to just collect the card and button info for checkboxes that
either don't have the uMyLabel property, or have it empty:

> repeat with y = 1 to the number of cards of stack "MyStack"
>     if the mark of card y of stack "MyStack"= true then
>      put the number of buttons of card y of stack "MyStack"into nbr
>      repeat with n = 1 to nbr
>       if the style of button n of card y of stack "MyStack" is "checkbox"\
>           and the hilite of button n of card y of stack "MyStack"   then
>
              if  the uMyLabel of button n of card y of stack "MyStack" is
empty then
                put y &&  n & cr after theList
              end if
    -- temporarily suppress normal data collection
    --      put the uMyLabel of button n of card y of stack "MyStack" iinto tName
    --     put tName & cr after theList
>       end if
>      end repeat
>   end if
> end repeat

On the other hand if you don't care about that, then just add another test so
that you don't collect the ones where it's empty:

 > repeat with y = 1 to the number of cards of stack "MyStack"
 >     if the mark of card y of stack "MyStack"= true then
 >      put the number of buttons of card y of stack "MyStack"into nbr
 >      repeat with n = 1 to nbr
 >       if the style of button n of card y of stack "MyStack" is "checkbox"\
 >           and the hilite of button n of card y of stack "MyStack"   then
             put the uMyLabel of button n of card y of stack "MyStack" into tName
             if tName <> empty then
               put tName & cr after theList
             end if

 >       end if
 >      end repeat
 >   end if
 > end repeat

HTH,

Ben

_______________________________________________
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: Script problem

Charles Szasz
In reply to this post by charles61
Ben,

Thanks for your generous script suggestions! I did not expect to hear from a LC expert as yourself!

I tried both of your script suggestions that were in your previous email.They show the number of the card and the number of the checkbox that supposely had a blank custom property, uMyLabel. However, I went to each card and examine each checkbox for the existence of a custom property, uMyLabel, and found that each checkbox on the card that was reported to have a blank uMyLabel actually did have a string for it.

I also again went through each of the more than 800 checkboxes in my project and did not find any missing strings. So, I don't know what is accounting for the five blank lines in my field "recommendations".  I also checked for any invisible checkboxes and found none. There is also no group scripts for these checkboxes.

If you have more ideas or suggestions, please share them with me.

Charles Szasz
[hidden email]





_______________________________________________
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: Script problem

Charles Szasz
In reply to this post by charles61
Ben,

Thanks for your generous script suggestions! I did not expect to hear from a LC expert as yourself!

I tried both of your script suggestions that were in your previous email.They show the number of the card and the number of the checkbox that supposely had a blank custom property, uMyLabel. However, I went to each card and examine each checkbox for the existence of a custom property, uMyLabel, and found that each checkbox on the card that was reported to have a blank uMyLabel actually did have a string for it.

I also again went through each of the more than 800 checkboxes in my project and did not find any missing strings. So, I don't know what is accounting for the five blank lines in my field "recommendations".  I also checked for any invisible checkboxes and found none. There is also no group scripts for these checkboxes.

If you have more ideas or suggestions, please share them with me.

Sent from my iPad

_______________________________________________
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: Script problem

Ben Rubinstein
In reply to this post by Charles Szasz
On 25/10/2012 04:08, Charles Szasz wrote:
> I also again went through each of the more than 800 checkboxes in my project and did not find any missing strings. So, I don't know what is accounting for the five blank lines in my field "recommendations".
> ...
> If you have more ideas or suggestions, please share them with me.

Perhaps some of the strings contain leading or trailing returns - so you're
not collecting empty values, but when you put them all in a list you end up
with some blank lines.

So yet another variation might collect this information

 > repeat with y = 1 to the number of cards of stack "MyStack"
 >     if the mark of card y of stack "MyStack"= true then
 >      put the number of buttons of card y of stack "MyStack"into nbr
 >      repeat with n = 1 to nbr
 >       if the style of button n of card y of stack "MyStack" is "checkbox"\
 >           and the hilite of button n of card y of stack "MyStack"   then
 >
              put the uMyLabel of button n of card y of stack "MyStack" into tName
              if tName contains cr then
                put y && n & cr after theList
              end if
    -- temporarily suppress normal data collection
    --      put the uMyLabel of button n of card y of stack "MyStack" iinto tName
    --     put tName & cr after theList
 >       end if
 >      end repeat
 >   end if
 > end repeat

... or if you just want to suppress it from  your output, and don't care where
it is, replace

    put tName & cr after theList

with
    put line 1 of tName & cr after theList

HTH

Ben

_______________________________________________
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: Script problem

Thierry Douez
2012/10/25 Ben Rubinstein <[hidden email]>:
> On 25/10/2012 04:08, Charles Szasz wrote:
>>
>> I also again went through each of the more than 800 checkboxes in my
>> project and did not find any missing strings. So, I don't know what is
>> accounting for the five blank lines in my field "recommendations".
>> ...
>> If you have more ideas or suggestions, please share them with me.

Hi,

my script was a start to search the culprits...

What could happen is to have invisible chars, tab, cr or white spaces.
So, I would check for all these chars...

HTH

Thierry

>
> Perhaps some of the strings contain leading or trailing returns - so you're
> not collecting empty values, but when you put them all in a list you end up
> with some blank lines.
>
> So yet another variation might collect this information
>
>> repeat with y = 1 to the number of cards of stack "MyStack"
>>     if the mark of card y of stack "MyStack"= true then
>>      put the number of buttons of card y of stack "MyStack"into nbr
>>      repeat with n = 1 to nbr
>>       if the style of button n of card y of stack "MyStack" is "checkbox"\
>>           and the hilite of button n of card y of stack "MyStack"   then
>>
>              put the uMyLabel of button n of card y of stack "MyStack" into
> tName
>              if tName contains cr then
>                put y && n & cr after theList
>              end if
>    -- temporarily suppress normal data collection
>    --      put the uMyLabel of button n of card y of stack "MyStack" iinto
> tName
>    --     put tName & cr after theList
>>       end if
>>      end repeat
>>   end if
>> end repeat
>
> ... or if you just want to suppress it from  your output, and don't care
> where it is, replace
>
>    put tName & cr after theList
>
> with
>    put line 1 of tName & cr after theList
>
> HTH
>
> Ben
>
> _______________________________________________
> 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: Script problem

charles61
Thierry,

Thanks for your suggestion! I do have a cr after each string for each uMyLabel so when it is inserted into my scrolling field the checkbox labels are separated by a cr. I would expect this only to affect the subsequent checked checkbox after the initial checked checkbox.  This was not a problem in my sample test stack which had about 40-50 checkboxes. I did not encounter any blank lines before any checkbox uMyLabels were inserted in my field, which is intended for printing. 

As you can see from my script, only checked checkboxes on marked cards are inserted in the scrolling field. If only one checkbox is checked, there are five blank lines before the checkbox label in my actual project. So I am still at a loss on what is going on. I have checked my settings for scrolling field for simple answer but found nothing. 

You might be wondering why I am using this code. I am trying to set up so that only checked checkboxes are printed in a print out of recommendations list selected by the user. My original version of my project printed all of the checkboxes regardless of whether they were selected by the user. 

Again, thanks for your ideas and suggestions!

Sent from my iPad

On Oct 25, 2012, at 5:56 AM, "Thierry Douez [via Runtime Revolution]" <[hidden email]> wrote:

2012/10/25 Ben Rubinstein <[hidden email]>:
> On 25/10/2012 04:08, Charles Szasz wrote:
>>
>> I also again went through each of the more than 800 checkboxes in my
>> project and did not find any missing strings. So, I don't know what is
>> accounting for the five blank lines in my field "recommendations".
>> ...
>> If you have more ideas or suggestions, please share them with me.

Hi,

my script was a start to search the culprits...

What could happen is to have invisible chars, tab, cr or white spaces.
So, I would check for all these chars...

HTH

Thierry

>
> Perhaps some of the strings contain leading or trailing returns - so you're
> not collecting empty values, but when you put them all in a list you end up
> with some blank lines.
>
> So yet another variation might collect this information
>
>> repeat with y = 1 to the number of cards of stack "MyStack"
>>     if the mark of card y of stack "MyStack"= true then
>>      put the number of buttons of card y of stack "MyStack"into nbr
>>      repeat with n = 1 to nbr
>>       if the style of button n of card y of stack "MyStack" is "checkbox"\
>>           and the hilite of button n of card y of stack "MyStack"   then
>>
>              put the uMyLabel of button n of card y of stack "MyStack" into
> tName
>              if tName contains cr then
>                put y && n & cr after theList
>              end if
>    -- temporarily suppress normal data collection
>    --      put the uMyLabel of button n of card y of stack "MyStack" iinto
> tName
>    --     put tName & cr after theList
>>       end if
>>      end repeat
>>   end if
>> end repeat
>
> ... or if you just want to suppress it from  your output, and don't care
> where it is, replace
>
>    put tName & cr after theList
>
> with
>    put line 1 of tName & cr after theList
>
> HTH
>
> Ben
>
> _______________________________________________
> 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



If you reply to this email, your message will be added to the discussion below:
http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656635.html
To unsubscribe from Script problem, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Script problem

Charles Szasz
In reply to this post by charles61
Ben,

Many thanks for your suggestions! I greatly appreciate your suggestions and Therry's suggestions. As I indicated, five blank lines appear before my checked checkbox even if only one checkbox is checked. There are no cr or tabs before the uMyLabel strings. There is a cr after each uMyLabel. But that should only affect the next insertion of a checked checkbox and not the initial checked checkbox. Anyway, I will keep working on this problem. Many thanks for taking the time to try to help me!

Sent from my iPad

_______________________________________________
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: Script problem

Thierry Douez
In reply to this post by charles61
2012/10/25 charles61 <[hidden email]>:
> Thierry,
>
> Thanks for your suggestion! I do have a cr after each string for each uMyLabel so when it is inserted into my scrolling field the checkbox labels are separated by a cr. I would expect this only to affect the subsequent checked checkbox after the initial checked checkbox.  This was not a problem in my sample test stack which had about 40-50 checkboxes. I did not encounter any blank lines before any checkbox uMyLabels were inserted in my field, which is intended for printing.
>
> As you can see from my script, only checked checkboxes on marked cards are inserted in the scrolling field. If only one checkbox is checked, there are five blank lines before the checkbox label in my actual project. So I am still at a loss on what is going on. I have checked my settings for scrolling field for simple answer but found nothing.

Well, for me I think your script is allright.
I still suspect your datas are not, but this is a guess.

If you feel so, send me your stack and I can have a quick look.

HTH,

Thierry

>
> You might be wondering why I am using this code. I am trying to set up so that only checked checkboxes are printed in a print out of recommendations list selected by the user. My original version of my project printed all of the checkboxes regardless of whether they were selected by the user.
>
> Again, thanks for your ideas and suggestions!
>
> Sent from my iPad
>
> On Oct 25, 2012, at 5:56 AM, "Thierry Douez [via Runtime Revolution]" <[hidden email]> wrote:
>
>> 2012/10/25 Ben Rubinstein <[hidden email]>:
>> > On 25/10/2012 04:08, Charles Szasz wrote:
>> >>
>> >> I also again went through each of the more than 800 checkboxes in my
>> >> project and did not find any missing strings. So, I don't know what is
>> >> accounting for the five blank lines in my field "recommendations".
>> >> ...
>> >> If you have more ideas or suggestions, please share them with me.
>>
>> Hi,
>>
>> my script was a start to search the culprits...
>>
>> What could happen is to have invisible chars, tab, cr or white spaces.
>> So, I would check for all these chars...
>>
>> HTH
>>
>> Thierry
>>
>> >
>> > Perhaps some of the strings contain leading or trailing returns - so you're
>> > not collecting empty values, but when you put them all in a list you end up
>> > with some blank lines.
>> >
>> > So yet another variation might collect this information
>> >
>> >> repeat with y = 1 to the number of cards of stack "MyStack"
>> >>     if the mark of card y of stack "MyStack"= true then
>> >>      put the number of buttons of card y of stack "MyStack"into nbr
>> >>      repeat with n = 1 to nbr
>> >>       if the style of button n of card y of stack "MyStack" is "checkbox"\
>> >>           and the hilite of button n of card y of stack "MyStack"   then
>> >>
>> >              put the uMyLabel of button n of card y of stack "MyStack" into
>> > tName
>> >              if tName contains cr then
>> >                put y && n & cr after theList
>> >              end if
>> >    -- temporarily suppress normal data collection
>> >    --      put the uMyLabel of button n of card y of stack "MyStack" iinto
>> > tName
>> >    --     put tName & cr after theList
>> >>       end if
>> >>      end repeat
>> >>   end if
>> >> end repeat
>> >
>> > ... or if you just want to suppress it from  your output, and don't care
>> > where it is, replace
>> >
>> >    put tName & cr after theList
>> >
>> > with
>> >    put line 1 of tName & cr after theList
>> >
>> > HTH
>> >
>> > Ben
>> >
>> > _______________________________________________
>> > 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
>>
>>
>> If you reply to this email, your message will be added to the discussion below:
>> http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656635.html
>> To unsubscribe from Script problem, click here.
>> NAML
>
>
>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656636.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: Script problem

charles61
This post has NOT been accepted by the mailing list yet.
Thierry,

Thanks! I may take you on your offer. I will work on the script some more.

Sent from my iPad

On Oct 25, 2012, at 10:06 AM, "Thierry Douez [via Runtime Revolution]" <[hidden email]> wrote:

2012/10/25 charles61 <[hidden email]>:
> Thierry,
>
> Thanks for your suggestion! I do have a cr after each string for each uMyLabel so when it is inserted into my scrolling field the checkbox labels are separated by a cr. I would expect this only to affect the subsequent checked checkbox after the initial checked checkbox.  This was not a problem in my sample test stack which had about 40-50 checkboxes. I did not encounter any blank lines before any checkbox uMyLabels were inserted in my field, which is intended for printing.
>
> As you can see from my script, only checked checkboxes on marked cards are inserted in the scrolling field. If only one checkbox is checked, there are five blank lines before the checkbox label in my actual project. So I am still at a loss on what is going on. I have checked my settings for scrolling field for simple answer but found nothing.

Well, for me I think your script is allright.
I still suspect your datas are not, but this is a guess.

If you feel so, send me your stack and I can have a quick look.

HTH,

Thierry

>
> You might be wondering why I am using this code. I am trying to set up so that only checked checkboxes are printed in a print out of recommendations list selected by the user. My original version of my project printed all of the checkboxes regardless of whether they were selected by the user.
>
> Again, thanks for your ideas and suggestions!
>
> Sent from my iPad
>
> On Oct 25, 2012, at 5:56 AM, "Thierry Douez [via Runtime Revolution]" <[hidden email]> wrote:
>
>> 2012/10/25 Ben Rubinstein <[hidden email]>:
>> > On 25/10/2012 04:08, Charles Szasz wrote:
>> >>
>> >> I also again went through each of the more than 800 checkboxes in my
>> >> project and did not find any missing strings. So, I don't know what is
>> >> accounting for the five blank lines in my field "recommendations".
>> >> ...
>> >> If you have more ideas or suggestions, please share them with me.
>>
>> Hi,
>>
>> my script was a start to search the culprits...
>>
>> What could happen is to have invisible chars, tab, cr or white spaces.
>> So, I would check for all these chars...
>>
>> HTH
>>
>> Thierry
>>
>> >
>> > Perhaps some of the strings contain leading or trailing returns - so you're
>> > not collecting empty values, but when you put them all in a list you end up
>> > with some blank lines.
>> >
>> > So yet another variation might collect this information
>> >
>> >> repeat with y = 1 to the number of cards of stack "MyStack"
>> >>     if the mark of card y of stack "MyStack"= true then
>> >>      put the number of buttons of card y of stack "MyStack"into nbr
>> >>      repeat with n = 1 to nbr
>> >>       if the style of button n of card y of stack "MyStack" is "checkbox"\
>> >>           and the hilite of button n of card y of stack "MyStack"   then
>> >>
>> >              put the uMyLabel of button n of card y of stack "MyStack" into
>> > tName
>> >              if tName contains cr then
>> >                put y && n & cr after theList
>> >              end if
>> >    -- temporarily suppress normal data collection
>> >    --      put the uMyLabel of button n of card y of stack "MyStack" iinto
>> > tName
>> >    --     put tName & cr after theList
>> >>       end if
>> >>      end repeat
>> >>   end if
>> >> end repeat
>> >
>> > ... or if you just want to suppress it from  your output, and don't care
>> > where it is, replace
>> >
>> >    put tName & cr after theList
>> >
>> > with
>> >    put line 1 of tName & cr after theList
>> >
>> > HTH
>> >
>> > Ben
>> >
>> > _______________________________________________
>> > 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
>>
>>
>> If you reply to this email, your message will be added to the discussion below:
>> http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656635.html
>> To unsubscribe from Script problem, click here.
>> NAML
>
>
>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656636.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



If you reply to this email, your message will be added to the discussion below:
http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656638.html
To unsubscribe from Script problem, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Script problem

charles61
This post has NOT been accepted by the mailing list yet.
In reply to this post by Thierry Douez
Therry,

I have resolved my script problem. The new script removes the five blank lines.  FYI, here is the new script:

 repeat with y = 1 to the number of cards of stack "myProject"
      if the mark of card y of stack "myProject"= true then
         put the number of buttons of card y of stack "myProject"into nbr
         repeat with n = 1 to nbr
            if the style of button n of card y of stack "myProject" is "checkbox"\
                  and the hilite of button n of card y of stack "myProject" is true
             and the uMyLabel of button n of card y of stack "myProject" <> ""
            then
               put the uMyLabel of button n of card y of stack "myProject" into tName 
               put tName & cr after theList
              
            end if
         end repeat
      end if
   end repeat

   

   
   delete char -1 of theList
   put theList into field "recommendations"

Thanks very much for your time and suggestions!

Charles Szasz
[hidden email]




On Oct 25, 2012, at 10:06 AM, Thierry Douez [via Runtime Revolution] <[hidden email]> wrote:

2012/10/25 charles61 <<a href="x-msg://57/user/SendEmail.jtp?type=node&amp;node=4656638&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]>:
> Thierry,
>
> Thanks for your suggestion! I do have a cr after each string for each uMyLabel so when it is inserted into my scrolling field the checkbox labels are separated by a cr. I would expect this only to affect the subsequent checked checkbox after the initial checked checkbox.  This was not a problem in my sample test stack which had about 40-50 checkboxes. I did not encounter any blank lines before any checkbox uMyLabels were inserted in my field, which is intended for printing.
>
> As you can see from my script, only checked checkboxes on marked cards are inserted in the scrolling field. If only one checkbox is checked, there are five blank lines before the checkbox label in my actual project. So I am still at a loss on what is going on. I have checked my settings for scrolling field for simple answer but found nothing.

Well, for me I think your script is allright.
I still suspect your datas are not, but this is a guess.

If you feel so, send me your stack and I can have a quick look.

HTH,

Thierry

>
> You might be wondering why I am using this code. I am trying to set up so that only checked checkboxes are printed in a print out of recommendations list selected by the user. My original version of my project printed all of the checkboxes regardless of whether they were selected by the user.
>
> Again, thanks for your ideas and suggestions!
>
> Sent from my iPad
>
> On Oct 25, 2012, at 5:56 AM, "Thierry Douez [via Runtime Revolution]" <<a href="x-msg://57/user/SendEmail.jtp?type=node&amp;node=4656638&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email]> wrote:
>
>> 2012/10/25 Ben Rubinstein <[hidden email]>:
>> > On 25/10/2012 04:08, Charles Szasz wrote:
>> >>
>> >> I also again went through each of the more than 800 checkboxes in my
>> >> project and did not find any missing strings. So, I don't know what is
>> >> accounting for the five blank lines in my field "recommendations".
>> >> ...
>> >> If you have more ideas or suggestions, please share them with me.
>>
>> Hi,
>>
>> my script was a start to search the culprits...
>>
>> What could happen is to have invisible chars, tab, cr or white spaces.
>> So, I would check for all these chars...
>>
>> HTH
>>
>> Thierry
>>
>> >
>> > Perhaps some of the strings contain leading or trailing returns - so you're
>> > not collecting empty values, but when you put them all in a list you end up
>> > with some blank lines.
>> >
>> > So yet another variation might collect this information
>> >
>> >> repeat with y = 1 to the number of cards of stack "MyStack"
>> >>     if the mark of card y of stack "MyStack"= true then
>> >>      put the number of buttons of card y of stack "MyStack"into nbr
>> >>      repeat with n = 1 to nbr
>> >>       if the style of button n of card y of stack "MyStack" is "checkbox"\
>> >>           and the hilite of button n of card y of stack "MyStack"   then
>> >>
>> >              put the uMyLabel of button n of card y of stack "MyStack" into
>> > tName
>> >              if tName contains cr then
>> >                put y && n & cr after theList
>> >              end if
>> >    -- temporarily suppress normal data collection
>> >    --      put the uMyLabel of button n of card y of stack "MyStack" iinto
>> > tName
>> >    --     put tName & cr after theList
>> >>       end if
>> >>      end repeat
>> >>   end if
>> >> end repeat
>> >
>> > ... or if you just want to suppress it from  your output, and don't care
>> > where it is, replace
>> >
>> >    put tName & cr after theList
>> >
>> > with
>> >    put line 1 of tName & cr after theList
>> >
>> > HTH
>> >
>> > Ben
>> >
>> > _______________________________________________
>> > 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
>>
>>
>> If you reply to this email, your message will be added to the discussion below:
>> http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656635.html
>> To unsubscribe from Script problem, click here.
>> NAML
>
>
>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656636.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> _______________________________________________
> use-livecode mailing list
> <a href="x-msg://57/user/SendEmail.jtp?type=node&amp;node=4656638&amp;i=2" target="_top" rel="nofollow" link="external">[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
<a href="x-msg://57/user/SendEmail.jtp?type=node&amp;node=4656638&amp;i=3" target="_top" rel="nofollow" link="external">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



If you reply to this email, your message will be added to the discussion below:
http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656638.html
To unsubscribe from Script problem, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Script problem

Dick Kriesel
In reply to this post by Thierry Douez
Charles, please let us know what the problem was.

If the problem persists, I suggest you check the whether the suspect checkboxes may be affected by a getProp for "uMyLabel," or by a custom property set.

-- Dick
_______________________________________________
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: Script problem

charles61
Dick,

As far as I can tell, the problem had to do with other marked cards that had checkboxes despite not having a custom property. When I initially tested my code with a sample stack, all of the cards were marked and had checkboxes with custom properties. 

In my actual project, there were marked cards but some of the cards did not have checkboxes with custom properties. When I added a little bit more code to catch my empty custom properties, my code was working again without the insertion of five blank lines.  Despite Therry's code to identify checkboxes that had my custom property, I had cards identified as having checkboxes with custom properties when there were none on the cards. Again, I checked all of my checkboxes several times and could not find any with blank strings for custom properties.  

Charles Szasz
[hidden email]




On Oct 26, 2012, at 6:10 PM, "Dick Kriesel [via Runtime Revolution]" <[hidden email]> wrote:

Charles, please let us know what the problem was.

If the problem persists, I suggest you check the whether the suspect checkboxes may be affected by a getProp for "uMyLabel," or by a custom property set.

-- Dick
_______________________________________________
use-livecode mailing list
<a href="x-msg://160/user/SendEmail.jtp?type=node&amp;node=4656682&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



If you reply to this email, your message will be added to the discussion below:
http://runtime-revolution.278305.n4.nabble.com/Script-problem-tp4656616p4656682.html
To unsubscribe from Script problem, click here.
NAML