Hi,
With this script every time I go to a card it gets the content of the fld findlot and puts it into a scrolling fld cpound on another cd inventory1.
It works great. But, it puts an empty line in between each copied entry and I want single space.
Any suggestion are appreciated. Thanks! - Patrick
on openCard
if the hilite of btn "Recent" of cd "inventory1" of stack "inventory" is true then
if there is fld "findlot" then
put fld "findlot" & return after fld "cpound" of cd "inventory1" of stack "inventory"
end if
end if
end openCard
This is what it does:
11330 - 11 - RG01067 - Cacao Butter - hr3D4
11328 - 11 - RG01070 - Cacao powder - hr4C2
11611 - 11 - RG01058 - Boldo, whole - hr2B1
11861 - 11 - RG01071 - Cacao, beans - R2
This is what I want:
11330 - 11 - RG01067 - Cacao Butter - hr3D4
11328 - 11 - RG01070 - Cacao powder - hr4C2
11611 - 11 - RG01058 - Boldo, whole - hr2B1
11861 - 11 - RG01071 - Cacao, beans - R2
extra blank line
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: extra blank line
Hi.
This is an oldie but goodie.
There may be an errant return in your field data or elsewhere. It seems simple and logical to just place new data AFTER the old, but you can get tripped up that way.
What I always do is something like this:
put yourNewData into line the number of lines of fld "yourTargetField" + 1 of fld "yourTargetField".
Now the next line in the field is always identified directly, and the new data will fall into, er, line.
But beware, if there are, for some reason, several more returns (which are invisible) in the target field, then you might see your data posted even lower down. There are ways around this as well, of course, but usually the more common situation you are in is with a single invisible return bumping things down one line.
Write back if you want to explore this further, and make sure that the next visible empty line is always the target line. And of course you can always delete blank lines in the final data, perhaps each time you change it, but that is inelegant.
Craig Newman
This is an oldie but goodie.
There may be an errant return in your field data or elsewhere. It seems simple and logical to just place new data AFTER the old, but you can get tripped up that way.
What I always do is something like this:
put yourNewData into line the number of lines of fld "yourTargetField" + 1 of fld "yourTargetField".
Now the next line in the field is always identified directly, and the new data will fall into, er, line.
But beware, if there are, for some reason, several more returns (which are invisible) in the target field, then you might see your data posted even lower down. There are ways around this as well, of course, but usually the more common situation you are in is with a single invisible return bumping things down one line.
Write back if you want to explore this further, and make sure that the next visible empty line is always the target line. And of course you can always delete blank lines in the final data, perhaps each time you change it, but that is inelegant.
Craig Newman
Re: extra blank line
Thanks Craig!
This was the final, it works great. Patrick
on openCard
if the hilite of btn "Recent" of cd "inventory1" of stack "inventory" is true then
if there is fld "findlot" then
put fld "findlot" into line the number of lines of fld "cpound" of cd "inventory1"+ 1 of fld "cpound" of cd "inventory1"
end if
end if
end openCard
This was the final, it works great. Patrick
on openCard
if the hilite of btn "Recent" of cd "inventory1" of stack "inventory" is true then
if there is fld "findlot" then
put fld "findlot" into line the number of lines of fld "cpound" of cd "inventory1"+ 1 of fld "cpound" of cd "inventory1"
end if
end if
end openCard
Re: extra blank line
Hi freinds,
I highly recommend to use brackets in this case, since I found that the engine is getting
less and less forgiving with every new version!
...
put fld "findlot" into line the number of lines of fld "cpound" of cd "inventory1"+ 1 of fld "cpound" of cd "inventory1"
...
Better:
...
put fld "findlot" into line (the number of lines of fld "cpound" of cd "inventory1"+ 1) of fld "cpound" of cd "inventory1"
...
Or even better (for debugging purposes!):
...
put the num of lines of fld "cpound" of cd "inventory1" into tNum
put fld "findlot" into line (tNum + 1) of fld "cpound" of cd "inventory1"
...
AND this is also more redable!
Best
Klaus
I highly recommend to use brackets in this case, since I found that the engine is getting
less and less forgiving with every new version!
...
put fld "findlot" into line the number of lines of fld "cpound" of cd "inventory1"+ 1 of fld "cpound" of cd "inventory1"
...
Better:
...
put fld "findlot" into line (the number of lines of fld "cpound" of cd "inventory1"+ 1) of fld "cpound" of cd "inventory1"
...
Or even better (for debugging purposes!):
...
put the num of lines of fld "cpound" of cd "inventory1" into tNum
put fld "findlot" into line (tNum + 1) of fld "cpound" of cd "inventory1"
...
AND this is also more redable!

Best
Klaus