Testing and experimenting with your code snippets now... I will post
back my results in a few (I plan on updating gist with your examples
with full credit and link back to your posts in this thread, I hope
ya'll don't mind?)
Thanks!!!!
BBS,
Micky
See inline replies below.
On Thu, Apr 7, 2011 at 11:11 AM, kevin furze <ke...@oakbeam.co.uk> wrote:
> I found it difficult to remember which classes use macros that I
> create and consequently, I had to work out which classes needed to be
> recompiled whenever I changed/added a new macro
> so I created a new class that just included a reference to my macros,
> no classmethods, just the "Include" statement - example
> now whenever I need to access myMacros, I simply use the "extend"
> syntax at the top of my new class - example
Ooooh, that's a great idea! Thank you for sharing!
To be truthfully honest, I have only used macros (of my own creation)
in RULEs, for example:
https://github.com/mhulse/custom.rg.ApDateTimeRule/blob/master/custom.rg.ApDateTimeRule.csr
You have inspired me to create a Macro routine so I can experiment and
learn some new stuff.
In fact, I have been getting "missing right parenthesis", and other
errors, when using "set foo = XXXX" and/or ##Continue... I think it is
because I am writing the macro in a CSP page (vs. using studio and
storing my macro as a .mac routine). I am hoping that using Studio and
creating a .mac file will give me a little more freedom and less
CSP/compile errors. :D
> doing this enables me to re-compile anyclass that references
> "myMacros"
That's cool!
I have only ever used "Include myMacro" at the top of the class... I
did not realize I could extend a macro routine, that's slick!
Just out of curiosity, what are the steps you take to re-compile
classes that refernece "myMacros"? Sorry if that is a silly
question... Even though I have been using COS for a few years now,
there is still so much that is new to me. Feel free to point me
towards the manual on this one. :)
> one other thing, a macro can call another macro and that can call
> another macro (ie nested macros), don't be afraid to experiment - take
> a look at some of the system macros, there;'s a lot of good code
> examples there, it takes a while to find which system macros are good
> examples, start with "large macro files" and work down the files in
> "size order"
Awesome! Thanks a billion for all of the tips! :)
Checking system macros now (i.e. changed to the %SYS namespace in
Studio and browsing through the Routines there... Is this what you
mean?)
Thanks Kev!
Cheers,
Micky
--
Micky Hulse
Web Content Editor
The Register-Guard
3500 Chad Drive
Eugene, OR 97408
Phone: (541) 338-2621
Fax: (541) 683-7631
Web: <http://www.registerguard.com>
On Thu, Apr 7, 2011 at 12:29 PM, Micky Hulse <mickyhul...@gmail.com> wrote:
> because I am writing the macro in a CSP page (vs. using studio and
> storing my macro as a .mac routine). I am hoping that using Studio and
That should be ".inc", not ".mac". Sorry about my confusion on the
file extension for ObjectScript macros.
I just posted some updated code:
https://gist.github.com/906837
I was never able to get multi-line macro to work in that context (CSP
page/CSP methods/CSP script).
I am currently in the process of creating/writing my first INC file
(and class that extends that mac file) so I am hoping that will give
me the multi-line and variable functionality that a CSP file does not.
Thanks again! I will post back my results.
I really appreciate the help Kev and Ian!
Cheers,
Micky
On Thu, Apr 7, 2011 at 11:23 PM, kevin furze <ke...@oakbeam.co.uk> wrote:
> quick and easy, when you know ;-)
> ...<snip>...
Oh, that sounds too easy!!!
Thanks so much for the pro tips! I can't wait to experiment. :)
> some system macros,
> LANGF11ovr.inc
> ROLLBACK.inc
> ...<snip>...
> have a look, they may not be easy to follow, but they give good
> concepts that you may be able to follow.
You ROCK! Thanks so much Kevin (and Ian), I really appreciate all of
your help! :)
Have an excellent weekend!