Welcome To icode4fun.com
This website is currently under construction.
icode4fun.com will be a place to find helpful, useful, and practical tips for
programming in various languages.쯳pan>At present
the MUMPS or Cache (www.intersystems.com) and Java (www.java.sun.com)
programming languages are ones that will be discussed here.쯳pan>This site is for programming enthusiasts
looking for ways to improve efficiency and effectiveness or just practical
examples of coding scenarios.
My name is Dale Marshall
and this site will be a place for me to share information with others and maybe
some of you would like to share some ideas as well.쯳pan>There are as many programming styles as there
are programmers and I am not trying to tell anyone how to code.쯳pan>Still a site with some practical ﳰan>how toﳰan>sﳰan> and ﳰan>pitfalls to
avoidﳰan> seems to be a good idea.쯳pan>For
Java programmers this may not seem that necessary, with so many books and the
JDC available out there.쯳pan>For MUMPS/Cache
programmers there is some online documentation and a few books, but most of
this documentation is at a ﳰan>metaﳰan> reference level; where the commands are given with cryptic explanations
and overly simple examples.쯳pan>I think
Cacheﳰan>s online documentation is a great place to start though.쯳pan>Still for practical use I and others have
found ourselves looking for more advanced information and examples.쯳pan>Therefore, I thought I would create a place
where we could share our ideas.
Okay so here is the place
to share, but where is the content?쯳pan>Well
it is on its way.
Examples of what you will
find here are as follows:
㰡n style='font:7.0pt "Times New Roman"'>
Using a FOR loop instead of a label and GOTO to prompt a user and
continue to prompt until a valid response is obtained.쯳pan>Why use GOTO, when you could be so much more
robust and use FOR or WHILE or DO WHILE?꼯span>After all, we just want to loop continuously prompting until we get
valid response; there is not need to use the potentially dangerous GOTO, when
the FOR command is ideally suited for this situation.
㰡n style='font:7.0pt "Times New Roman"'>
Using the first day of a
month to find the varying last day of a month; this even handles leap years, it
is Y2K compliant, and is so easy.쯳pan>You
are laughing at Y2K, after all it August 2003, but I recently had to send code
back to a vendor, as it was not Y2K compliant; sad really is it not.쯳pan>Course that is not the only occasion or
vendor I still have Y2K issues with.쯳pan>For
instance I print my own checks via commercially available software and the
checks are fine as the date of issue is printed on the check.쯳pan>However, the deposit slips print a hardcoded ﳰan>19ﳰan> for the millennium and century leaving only the decade and year to be
filled in.쯳pan>Still, excluding the Y2K
factor, finding the last day of the previous month or any month seems to be a
point of confusion for some.쯳pan>I have seen
code that is about 300 lines worth of what day is it (Monday, Tuesday, ﳰan>)
and is it a leap year and so on just to figure out the right date.쯳pan>Why?꼯span>You use the first day of the month of the following month to the month
you need, get the internal MUMPS/Cache date for that, then subtract 1 and viola
you have the last day of the month you need it for.
㰡n style='font:7.0pt "Times New Roman"'>
Using Java for the
application and Cache for the database using Cache objects exported as Java
classes.쯳pan>
Like to check out more
examples like these?༯span>then check back soon.