Hi Tom! Thanks again for the pro help, I really appreciate it. :)
On Wed, Jun 26, 2013 at 5:48 PM, Tom Fitzgibbon <
t...@mul.com> wrote:
> If this is a Cache DB then obviously you can store/retrieve the data with
> any or no explicit delimiters. Non-Cache DB might have it's own special
> delimiters, none, etc. Either way you would mimic what the DB does in Cache
> code.
> Something like: f i=1:1 r x q:'$l(x) s $list(mystring,i)=x w !
Thank you for providing example code for me to play with.
Honestly, my shorthand skills are not the sharpest ... I hate to admit
it, but I'll have to convert your code to long hand in order for me to
fully understand what you're doing (I actually enjoy converting
shorthand COS, as it's good practice for me).
With that said, I think I see what you're saying here ... And yes, I
am pulling from a Caché DB.
Details: I'm using someone else's code, so I'm not sure what
delimiters they have set and/or are using (I think at the deepest
level, it's an XML feed that gets translated and stored as a character
stream). Long story short, once I get my hands on the content/string
(at the web/template level) I can assign it to a variable.
> $c(13,10) or $c(10) are typical delimiters depending on your
> storage/retrieval. If you get to the display/print side use of control
> characters (CR-13, LF-10, ETX-3, etc) would cause different results based on
> characteristics of those devices. $c(13,10) goes all the way back to old
> printers (carriage return, the line feed).
Awesome, thanks for the detailed explanation, that's very helpful.
> Since I see you on this newsgroup a lot, you're probably asking something
> I'm not getting.
Oh, no, I think you get what I'm saying. In fact, I probably could
have been more clear. Sorry if there has been any confusion.
It looks like using $char(13, 10), and working with your examples,
will get me what I need (and then some).
OFF-ish TOPIC & shameless plug:
Here's the code that prompted my question:
<
https://github.com/registerguard/delim>
... in particular, my demo page code:
<
https://github.com/registerguard/delim/blob/master/delim/delim.csp>
See where I'm setting "string" variables? Specifically:
<
https://github.com/registerguard/delim/blob/master/delim/delim.csp#L162-L165>
Well, that's my way of pretending that the value of the string is
coming from our Caché DB.
For some reason, before talking to you, I was thinking that using
$char(10) wasn't going to be a good test case ...
Now, based on what you've said, it seems like using $char(10) is the
closest I'll get to mimicking the output from our DB (other than
actually using the DB).
On top of all that, in general, I was also curious to know if Caché
has something similar to PHP's heredoc and/or Python's triple-quoted
strings (sounds like there isn't anything similar).
Anyway, thanks again Tom! Sorry to chat your ear off.
Have a great night.
Cheers,
Micky