Inconsistent results in simple script

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

Inconsistent results in simple script

JOHN PATTEN-2
Hi All,

I have two, two column lists. Each list has the same barcode item (item 1). The second item in the first list is a username, and the second item in the second list is a serial number. I am trying to combine the username and serial number into one list. I have about 1000 lines in each list. However, I have cut my username list down to about 30. My script is leaving out username/serial number combinations that are common in each list. I am not sure why?

For example:

List 1

12345,johndoe
11234,maryjane
12234,stevesmith

List 2

12345,SDTKNY12345
12234,SDTKLL54RR2
11234,SDKTHYUPTO9

I’m sure there are more elegant ways to do this, but here is my script:

on mouseUp

   lock screen

   put cd fld "csv1" into tcsv1

   repeat for number of lines in tcsv1

      put line 1 of tcsv1 into tStudentInfo

      put item 1 of tStudentInfo into tbarcode

      put the number of chars of tBarcode into tCharCount

      --    if tCharCount > 5 then

      --       delete char 1 of tbarcode

      --    end if

      put cd fld "csv2" into tcsv2

      find tBarcode in cd fld "csv2"

      if the result is empty then

         put the foundLine into tLine

         select tLine

         --put the selectedText of tcsv2 into tdeviceInfo

         put the selectedText of cd fld "csv2" into tDeviceInfo

         delete char 1 of item 2 of tDeviceInfo
         put item 2 of tStudentInfo & "," & item 2 of tDeviceInfo & return after tUploadFile

               else

      end if

      put empty into tStudentInfo

      put empty into tbarcode

      put empty into tCharCount

      put empty into tLine

      put empty into tDeviceInfo

      delete line 1 of tcsv1

   end repeat

   put tUploadFile into cd fld "Upload File"

   unlock screen

end mouseUp


Any suggestions would be helpful.

Thank you!
John Patten
SUSD


_______________________________________________
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: Inconsistent results in simple script

dunbarxx
This post was updated on .
HI.

So, a single list. What is the relationship between the fact that a particular barcode refers both to a student and a serial number? In other words, if you had a single list, how would "12345" relate to both "john doe" and "SDTKNY12345"?
Would you simply have two lines:

12345,johndoe
12345,SDTKNY12345

And don't you already have what you asked for, a single list with user name and serial number?

Also, I do not understand what you mean when you said:

 "I have cut my username list down to about 30."

Does that mean that in your 1000 line first list, the usernames appear with multiple barcodes? Or are those lines empty? Or is that list now only 30 lines long?

It looks like this begs for an array, but I am missing what you expect as output. Whatever it is, the procedure will be simple. But I cannot even start to advise about that procedure until I know what the answer is.

Craig
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent results in simple script

dunbarxx
In reply to this post by JOHN PATTEN-2
On another note, are you an old Hypercard user? I noticed you used the term "cd fld".

Craig
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent results in simple script

JOHN PATTEN-2
In reply to this post by dunbarxx
Hi Craig,

I have about 1000 students that are in a library system showing them as having checked out an iPad. In the library system it uses the student username and the barcode as the item identifier.

I have another list that shows our iPads by barcode and serial number.

Unfortunately there is no way for me to pull a report that shows the student username and the device serial number in one report. So I was essentially searching for the barcode in both lists and then combining the username from one and the serial number from the other. Ultimately ending up with a list that consists of student username and device serial number.

I hope that is a little clearer.

Thank you!

John Patten
SUSD


> On Nov 16, 2016, at 12:22 PM, dunbarx <[hidden email]> wrote:
>
> HI.
>
> So, a single list. What is the relationship between the fact that a
> particular barcode refers both to a student and a serial number? In other
> words, if you had a single list, how would "12345" relate to both "john doe"
> and "SDTKNY12345"?
> Would you simply have two lines:
>
> 12345,johndoe
> 12345,SDTKNY12345
>
> Also, I do not understand what you mean when you said:
>
> "I have cut my username list down to about 30."
>
> Does that mean that in your 1000 line first list, the usernames appear with
> multiple barcodes? Or are those lines empty? Or is that list now only 30
> lines long?
>
> It looks like this begs for an array, but I am missing what you expect as
> output. Whatever it is, the procedure will be simple. But I cannot even
> start to advise about that procedure until I know what the answer is.
>
> Craig
>
>
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Inconsistent-results-in-simple-script-tp4710376p4710377.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: Inconsistent results in simple script

dunbarxx
In reply to this post by JOHN PATTEN-2
Ah.

OK, put the first list snippet into a field named "csv1" and the second snippet into a field named "csv2". Now make a button and put this into its script:
on mouseUp
   put fld "csv1" into student
   put fld "csv2" into serNum
   
   repeat with y = 1 to the number of lines of student
      put item 2 of line y of serNum into masterList[item 2 of line y of student][item 1 of line y of student]
   end repeat
breakPoint
end mouseUp

Check out the array in the debugger. Is this what you needed? Do you need help getting this data back "into the clear"?

Craig
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent results in simple script

Mike Bonner
In reply to this post by JOHN PATTEN-2
Craig is right, this is asking to be an array, though if you prefer a flat
file you can combine it at the end like so.

on mouseUp
repeat for each line tLine in field "csv1"
   put item 2 of tLine into tDataA[item 1 of tLine]
end repeat

repeat for each line tLIne in field "csv2"
   put comma & item 2 of tLine after tDataA[item 1 of tLine]
end repeat
combine tDataA with return and comma

/*
Places the following into tDataA
11234,maryjane,SDKTHYUPTO9
12234,stevesmith,SDTKLL54RR2
12345,johndoe,SDTKNY12345
*/
end mouseUp

On Wed, Nov 16, 2016 at 1:43 PM, JOHN PATTEN <[hidden email]> wrote:

> Hi Craig,
>
> I have about 1000 students that are in a library system showing them as
> having checked out an iPad. In the library system it uses the student
> username and the barcode as the item identifier.
>
> I have another list that shows our iPads by barcode and serial number.
>
> Unfortunately there is no way for me to pull a report that shows the
> student username and the device serial number in one report. So I was
> essentially searching for the barcode in both lists and then combining the
> username from one and the serial number from the other. Ultimately ending
> up with a list that consists of student username and device serial number.
>
> I hope that is a little clearer.
>
> Thank you!
>
> John Patten
> SUSD
>
>
> > On Nov 16, 2016, at 12:22 PM, dunbarx <[hidden email]> wrote:
> >
> > HI.
> >
> > So, a single list. What is the relationship between the fact that a
> > particular barcode refers both to a student and a serial number? In other
> > words, if you had a single list, how would "12345" relate to both "john
> doe"
> > and "SDTKNY12345"?
> > Would you simply have two lines:
> >
> > 12345,johndoe
> > 12345,SDTKNY12345
> >
> > Also, I do not understand what you mean when you said:
> >
> > "I have cut my username list down to about 30."
> >
> > Does that mean that in your 1000 line first list, the usernames appear
> with
> > multiple barcodes? Or are those lines empty? Or is that list now only 30
> > lines long?
> >
> > It looks like this begs for an array, but I am missing what you expect as
> > output. Whatever it is, the procedure will be simple. But I cannot even
> > start to advise about that procedure until I know what the answer is.
> >
> > Craig
> >
> >
> >
> > --
> > View this message in context: http://runtime-revolution.
> 278305.n4.nabble.com/Inconsistent-results-in-simple-script-
> tp4710376p4710377.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
>
_______________________________________________
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: Inconsistent results in simple script

Richard Gaskin
In reply to this post by JOHN PATTEN-2
JOHN PATTEN wrote:

 > I have two, two column lists. Each list has the same barcode item
 > (item 1). The second item in the first list is a username, and the
 > second item in the second list is a serial number. I am trying to
 > combine the username and serial number into one list. I have about
 > 1000 lines in each list. However, I have cut my username list down to
 > about 30. My script is leaving out username/serial number
 > combinations that are common in each list. I am not sure why?
 >
 > For example:
 >
 > List 1
 >
 > 12345,johndoe
 > 11234,maryjane
 > 12234,stevesmith
 >
 > List 2
 >
 > 12345,SDTKNY12345
 > 12234,SDTKLL54RR2
 > 11234,SDKTHYUPTO9
 >
 > I’m sure there are more elegant ways to do this, but here is my
 > script:
 >
 > on mouseUp
 >    lock screen
 >    put cd fld "csv1" into tcsv1
 >    repeat for number of lines in tcsv1
 >       put line 1 of tcsv1 into tStudentInfo
 >       put item 1 of tStudentInfo into tbarcode
 >       put the number of chars of tBarcode into tCharCount
 >       --    if tCharCount > 5 then
 >       --       delete char 1 of tbarcode
 >       --    end if
 >       put cd fld "csv2" into tcsv2
 >       find tBarcode in cd fld "csv2"
 >       if the result is empty then
 >          put the foundLine into tLine
 >          select tLine
 >          --put the selectedText of tcsv2 into tdeviceInfo
 >          put the selectedText of cd fld "csv2" into tDeviceInfo
 >          delete char 1 of item 2 of tDeviceInfo
 >          put item 2 of tStudentInfo & "," & item 2 of tDeviceInfo &
return after tUploadFile
 >                else
 >       end if
 >       put empty into tStudentInfo
 >       put empty into tbarcode
 >       put empty into tCharCount
 >       put empty into tLine
 >       put empty into tDeviceInfo
 >       delete line 1 of tcsv1
 >    end repeat
 >    put tUploadFile into cd fld "Upload File"
 >    unlock screen
 > end mouseUp
 >
 >
 > Any suggestions would be helpful.


Try this:

on mouseUp
    put fld "csv1" into tStudentArray
    split tStudentArray by cr and comma
    put fld "csv2" into tDeviceArray
    split tDeviceArray by cr and comma
    repeat for each key tStudentID in tStudentArray
       put tStudentArray[tStudentID] into tStudentName
       put tDeviceArray[tStudentID] into tDeviceID
       put tStudentID &","& tStudentName &","& tDeviceID &cr \
           after tCombinedList
    end repeat
    delete last char of tCombinedList -- trailing CR
    put tCombinedList into fld "Upload File"
end mouseUp


--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.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
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent results in simple script

JOHN PATTEN-2
In reply to this post by Mike Bonner
Thanks Mike and Craig,

One of my challenges is the two lists do not mirror each other by barcode number. The barcodes are not on the same lines in each list. That is why I was running the “find barcode in list two.”  I have teachers and other staff in the list of serial numbers and I was hoping not to have to weed them out of my lists so that the two lists lined up.

Can I use an array and still search be barcode prior to doing the username and serial number?

/..Yes Craig, old HyperCard habits are hard to break, at least for me :) …/

Thank you!

John Patten
SUSD



> On Nov 16, 2016, at 12:58 PM, Mike Bonner <[hidden email]> wrote:
>
> Craig is right, this is asking to be an array, though if you prefer a flat
> file you can combine it at the end like so.
>
> on mouseUp
> repeat for each line tLine in field "csv1"
>   put item 2 of tLine into tDataA[item 1 of tLine]
> end repeat
>
> repeat for each line tLIne in field "csv2"
>   put comma & item 2 of tLine after tDataA[item 1 of tLine]
> end repeat
> combine tDataA with return and comma
>
> /*
> Places the following into tDataA
> 11234,maryjane,SDKTHYUPTO9
> 12234,stevesmith,SDTKLL54RR2
> 12345,johndoe,SDTKNY12345
> */
> end mouseUp
>
> On Wed, Nov 16, 2016 at 1:43 PM, JOHN PATTEN <[hidden email]> wrote:
>
>> Hi Craig,
>>
>> I have about 1000 students that are in a library system showing them as
>> having checked out an iPad. In the library system it uses the student
>> username and the barcode as the item identifier.
>>
>> I have another list that shows our iPads by barcode and serial number.
>>
>> Unfortunately there is no way for me to pull a report that shows the
>> student username and the device serial number in one report. So I was
>> essentially searching for the barcode in both lists and then combining the
>> username from one and the serial number from the other. Ultimately ending
>> up with a list that consists of student username and device serial number.
>>
>> I hope that is a little clearer.
>>
>> Thank you!
>>
>> John Patten
>> SUSD
>>
>>
>>> On Nov 16, 2016, at 12:22 PM, dunbarx <[hidden email]> wrote:
>>>
>>> HI.
>>>
>>> So, a single list. What is the relationship between the fact that a
>>> particular barcode refers both to a student and a serial number? In other
>>> words, if you had a single list, how would "12345" relate to both "john
>> doe"
>>> and "SDTKNY12345"?
>>> Would you simply have two lines:
>>>
>>> 12345,johndoe
>>> 12345,SDTKNY12345
>>>
>>> Also, I do not understand what you mean when you said:
>>>
>>> "I have cut my username list down to about 30."
>>>
>>> Does that mean that in your 1000 line first list, the usernames appear
>> with
>>> multiple barcodes? Or are those lines empty? Or is that list now only 30
>>> lines long?
>>>
>>> It looks like this begs for an array, but I am missing what you expect as
>>> output. Whatever it is, the procedure will be simple. But I cannot even
>>> start to advise about that procedure until I know what the answer is.
>>>
>>> Craig
>>>
>>>
>>>
>>> --
>>> View this message in context: http://runtime-revolution.
>> 278305.n4.nabble.com/Inconsistent-results-in-simple-script-
>> tp4710376p4710377.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
>>
> _______________________________________________
> 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: Inconsistent results in simple script

JOHN PATTEN-2
Thanks Everyone,

One follow up question, how is the script that Richard provided:

on mouseUp
  put fld "csv1" into tStudentArray
  split tStudentArray by cr and comma
  put fld "csv2" into tDeviceArray
  split tDeviceArray by cr and comma
  repeat for each key tStudentID in tStudentArray
     put tStudentArray[tStudentID] into tStudentName
     put tDeviceArray[tStudentID] into tDeviceID
     put tStudentID &","& tStudentName &","& tDeviceID &cr \
         after tCombinedList
  end repeat
  delete last char of tCombinedList -- trailing CR
  put tCombinedList into fld "Upload File"
end mouseUp

…find the correct line via the barcode in the serial number list?  


Is he using the array item [tStudentID] (which I believe is actually [tBarcodeID]) to key in on the content in both arrays?  So in a sense, it is doing a find this barcode, but in an array construct?

When you don’t use arrays very much, and you have old, slow, brute force scripting skills, arrays are kind of hard to wrap your head around. But I obviously see their advantages :)

Thank you!




> On Nov 16, 2016, at 1:08 PM, JOHN PATTEN <[hidden email]> wrote:
>
> Thanks Mike and Craig,
>
> One of my challenges is the two lists do not mirror each other by barcode number. The barcodes are not on the same lines in each list. That is why I was running the “find barcode in list two.”  I have teachers and other staff in the list of serial numbers and I was hoping not to have to weed them out of my lists so that the two lists lined up.
>
> Can I use an array and still search be barcode prior to doing the username and serial number?
>
> /..Yes Craig, old HyperCard habits are hard to break, at least for me :) …/
>
> Thank you!
>
> John Patten
> SUSD
>
>
>
>> On Nov 16, 2016, at 12:58 PM, Mike Bonner <[hidden email]> wrote:
>>
>> Craig is right, this is asking to be an array, though if you prefer a flat
>> file you can combine it at the end like so.
>>
>> on mouseUp
>> repeat for each line tLine in field "csv1"
>>  put item 2 of tLine into tDataA[item 1 of tLine]
>> end repeat
>>
>> repeat for each line tLIne in field "csv2"
>>  put comma & item 2 of tLine after tDataA[item 1 of tLine]
>> end repeat
>> combine tDataA with return and comma
>>
>> /*
>> Places the following into tDataA
>> 11234,maryjane,SDKTHYUPTO9
>> 12234,stevesmith,SDTKLL54RR2
>> 12345,johndoe,SDTKNY12345
>> */
>> end mouseUp
>>
>> On Wed, Nov 16, 2016 at 1:43 PM, JOHN PATTEN <[hidden email]> wrote:
>>
>>> Hi Craig,
>>>
>>> I have about 1000 students that are in a library system showing them as
>>> having checked out an iPad. In the library system it uses the student
>>> username and the barcode as the item identifier.
>>>
>>> I have another list that shows our iPads by barcode and serial number.
>>>
>>> Unfortunately there is no way for me to pull a report that shows the
>>> student username and the device serial number in one report. So I was
>>> essentially searching for the barcode in both lists and then combining the
>>> username from one and the serial number from the other. Ultimately ending
>>> up with a list that consists of student username and device serial number.
>>>
>>> I hope that is a little clearer.
>>>
>>> Thank you!
>>>
>>> John Patten
>>> SUSD
>>>
>>>
>>>> On Nov 16, 2016, at 12:22 PM, dunbarx <[hidden email]> wrote:
>>>>
>>>> HI.
>>>>
>>>> So, a single list. What is the relationship between the fact that a
>>>> particular barcode refers both to a student and a serial number? In other
>>>> words, if you had a single list, how would "12345" relate to both "john
>>> doe"
>>>> and "SDTKNY12345"?
>>>> Would you simply have two lines:
>>>>
>>>> 12345,johndoe
>>>> 12345,SDTKNY12345
>>>>
>>>> Also, I do not understand what you mean when you said:
>>>>
>>>> "I have cut my username list down to about 30."
>>>>
>>>> Does that mean that in your 1000 line first list, the usernames appear
>>> with
>>>> multiple barcodes? Or are those lines empty? Or is that list now only 30
>>>> lines long?
>>>>
>>>> It looks like this begs for an array, but I am missing what you expect as
>>>> output. Whatever it is, the procedure will be simple. But I cannot even
>>>> start to advise about that procedure until I know what the answer is.
>>>>
>>>> Craig
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context: http://runtime-revolution.
>>> 278305.n4.nabble.com/Inconsistent-results-in-simple-script-
>>> tp4710376p4710377.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
>>>
>> _______________________________________________
>> 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


_______________________________________________
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: Inconsistent results in simple script

dunbarxx
In reply to this post by JOHN PATTEN-2
"The barcodes are not on the same lines in each list. "

In that case what Richard did, using the barcode as keys, will obviate that issue. Do you see? With arrays, the appropriate data can be made to go only with its associated keys, and the order of play does not matter. So the barcodes rule the procedure. Nor does it matter anymore if the lists are not of the same length. Arrays automatically manage all that.

Craig
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent results in simple script

dunbarxx
This post was updated on .
In reply to this post by JOHN PATTEN-2
"…find the correct line via the barcode in the serial number list?  

The resultant list combines all three parts of the data. To find any particular one, just use the lineOffset.

answer line lineOffset("12345",tCombinedList) of tCombinedList

or i guess you could find a name, and get the foundLine

No?

Craig
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent results in simple script

dunbarxx
"and you have old, slow, brute force scripting skills, "

on mouseUp
repeat for each line tLine in fld "csv1"
   put line lineOffset(item 1 of tLine,fld "csv1") of fld "csv1" & "," & \
   item 2 of line lineOffset(item 1 of tLine,fld "csv2") of fld "csv2" & return after temp
end repeat
put temp into fld "Upload File"
end mouseUp

Me too.

Craig
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent results in simple script

Richard Gaskin
In reply to this post by JOHN PATTEN-2
JOHN PATTEN wrote:
 > When you don’t use arrays very much, and you have old, slow, brute
 > force scripting skills, arrays are kind of hard to wrap your head
 > around. But I obviously see their advantages :)

Arrays are so useful in so many contexts that they're well worth
spending an afternoon experimenting with to really grok them.

Once grokked, they open up many worlds of simpler, more efficient algos
across a wide range of use cases.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.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
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent results in simple script

Mike Bonner
Yeah, you can use the same handler because order doesn't matter.  It
sounded from your description like the barcode was unique to 1 item, so it
should work dandy.  Once the array is built (assuming you decide to leave
it as an array and not combine it) the array is keyed by the barcode so its
easy to find the associated information.
Sorry for the late response, had to actually leave the house today.

On Wed, Nov 16, 2016 at 5:51 PM, Richard Gaskin <[hidden email]>
wrote:

> JOHN PATTEN wrote:
> > When you don’t use arrays very much, and you have old, slow, brute
> > force scripting skills, arrays are kind of hard to wrap your head
> > around. But I obviously see their advantages :)
>
> Arrays are so useful in so many contexts that they're well worth spending
> an afternoon experimenting with to really grok them.
>
> Once grokked, they open up many worlds of simpler, more efficient algos
> across a wide range of use cases.
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  ____________________________________________________________________
>  [hidden email]                http://www.FourthWorld.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: Inconsistent results in simple script

Bob Sneidar-2
In reply to this post by Richard Gaskin
Take Richard's advice. I did and I've never looked back. There are some situations where text parsing becomes cumbersome.

Bob S


> On Nov 16, 2016, at 16:51 , Richard Gaskin <[hidden email]> wrote:
>
> JOHN PATTEN wrote:
> > When you don’t use arrays very much, and you have old, slow, brute
> > force scripting skills, arrays are kind of hard to wrap your head
> > around. But I obviously see their advantages :)
>
> Arrays are so useful in so many contexts that they're well worth spending an afternoon experimenting with to really grok them.
>
> Once grokked, they open up many worlds of simpler, more efficient algos across a wide range of use cases.
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.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: Inconsistent results in simple script

Phil Davis-5
Amen!
First there was sliced bread...
Then there was LC text parsing...
Then came ARRAYS!
(choir singing in background)

Phil Davis


On 11/17/16 7:59 AM, Bob Sneidar wrote:

> Take Richard's advice. I did and I've never looked back. There are some situations where text parsing becomes cumbersome.
>
> Bob S
>
>
>> On Nov 16, 2016, at 16:51 , Richard Gaskin <[hidden email]> wrote:
>>
>> JOHN PATTEN wrote:
>>> When you don’t use arrays very much, and you have old, slow, brute
>>> force scripting skills, arrays are kind of hard to wrap your head
>>> around. But I obviously see their advantages :)
>> Arrays are so useful in so many contexts that they're well worth spending an afternoon experimenting with to really grok them.
>>
>> Once grokked, they open up many worlds of simpler, more efficient algos across a wide range of use cases.
>>
>> --
>> Richard Gaskin
>> Fourth World Systems
>> Software Design and Development for the Desktop, Mobile, and the Web
>> ____________________________________________________________________
>> [hidden email]                http://www.FourthWorld.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

--
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