Best way to Pass Results to a Field from an External
Mark Wieder
mwieder at ahsoftware.net
Mon Feb 12 22:21:04 EST 2007
Dave-
Monday, February 12, 2007, 7:55:17 AM, you wrote:
> put "line1" & cr & "line2" & cr & "line3" & cr & cr after field
> "DataLog"
> What is the best way to achieve this in a C/C++ External? I can see
> that I can get and set the contents of a Field but I can't see how to
> use the "after" key word. Do I have to do a "get" on the field copy
> the data to the end and then do a "set"? If so, do I use realloc() to
> make the buffer returned bigger?
> Any help on the would be greatly appreciated.
What's the aim here? If "speed" isn't part of the answer then I'd just
pass the strings back to transcript and let the engine do what it does
best. If you do need the speed then my approach would be to get the
contents of the field before the loop starts, then strcat each line in
the loop (yes, you'd have to do a realloc or malloc a new buffer for
the strcats), finally passing back the whole thing to the engine.
put AllMyStrings(field "DataLog") into field "DataLog"
--
-Mark Wieder
mwieder at ahsoftware.net
More information about the use-livecode
mailing list