Page 1 of 1

Chunk expressions

Posted: Mon Mar 19, 2012 9:10 am
by Nakia
Hi,
I am trying to isolate the last number which I colored in red here(can be 1 or 2 digits with and without decimal point) in a variable to then post into a field line by line.. these numbers (ones in Red) change every time I need to run this function so looking for figures is out of the question..

container looks like this.. can anyone think of a combination of chuck expressions that would achieve this?

DATA=1 - 1 - -
DATA=2 - 0 - -
DATA=3 - 1.5 - -
DATA=4 - 0 - -
DATA=5 - 5 - -
DATA=6 - 0 - -
DATA=7 - 7 - -
DATA=8 - 0 - -
DATA=9 - 6.5 - -
DATA=10 - 0 - -
DATA=11 - 8 - -
DATA=12 - 0 - -

Re: Chunk expressions

Posted: Mon Mar 19, 2012 9:37 am
by jmburnod
Hi Nakia,

You can use the itemdel like this:

Code: Select all

on mouseUp
   put fld 1 into tData
   put empty into tTheValues
   put the itemdel into OID
   set the itemdel to "-"
   repeat for each line tline in tData
      put the value of item 2 of tline & return after tTheValues
   end repeat
   delete char -1 of tTheValues
   set the itemdel to OID
   put tTheValues
end mouseUp
Best regards

Jean-Marc

Re: Chunk expressions

Posted: Mon Mar 19, 2012 11:36 am
by Nakia
Thanks,

this gave me enough to achieve what I needed.
Thank you...

Re: Chunk expressions

Posted: Mon Mar 19, 2012 1:44 pm
by Klaus
Hi friends,

hint:
Since "item 2 of tLine" is NOT an expression that need to be eVALUEated, you can just write:

Code: Select all

...
  repeat for each line tline in tData
      put item 2 of tline & return after tTheValues
     ##  put the value of item 2 of tline & return after tTheValues
   end repeat
...
Best

Klaus