Go Back   Science Forums
View Single Post
Old 06-10-2007   #15 (permalink)
CraigD's Avatar
CraigD
Creating


Location:
Silver Spring, MD, USA
 
CraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond repute
 



Not Ranked  0 score     
Thumbs up Saving MUMPS local symbol data

Quote:
Originally Posted by chendoh View Post
I DL, and installed 5.2.0.329.1_su, this morning, glad I have DSL, even with that it took 40".

Followed your prompts from post #9, and had my first game of NB just using your code....experimentation awaits!
Congratulations! I believe you are the first hypographer other than me with ready access to a MUMPS interpreter

Now that you have a technological edge over the competition (OK, only Jay-qu and Janus so far – clearly the lack of huge cash prizes is making this a rather low-key competition ), you should pretty quickly be able to trail-and-error your way to a winning solution – though likely not before you begin cursing my crude interface for its lack of a “save/restore” function
Quote:
A question, can the code be saved or does it have to be entered for each new game?
Yes, it can easily be saved.

XELCOL4 is, in MUMPS terms a “local symbol”, meaning it persists only as long as your job (terminal session). It’s easy to copy it to a persistent, on-disk “global”, by entering something like this (only needs to be done once, unless changes are made to XELCOL4):
Code:
m ^SAVENB=XELCOL4
Then, each time you start a new terminal session, you can copy it back to its local symbol with this:
Code:
m XELCOL4=^SAVENB
“M” is the abbreviation for the MUMPS command “merge” – you can enter the full keyword “merge” if you like, but most people prefer to use the abbreviations. Note that the only difference between a local and a global is that the latter begins with the special character “^”.

If you want a lot of convenience, you can create a small xecute code program to load and start the game, by entering something like
Code:
s ^playNB="m XELCOL4=^SAVENB x XELCOL4"
Then, to load and start the game, you need only enter (note that MUMPS local and global references are case sensitive, so “^playNB” is not the same as “^PlayNB” or “^playnb”):
Code:
x ^playNB
The global reference you use to store things is MUMPS is up to you – as long as you don’t use one being used for something else, it’s OK. You can tell if a global (such as “^MYGLOBAL”) exists by entering:
Code:
w $d(^MYGLOBAL)
If “0” is displayed, it doesn’t. You can use a single global name to store all things of a certain kind, such as xecute code from hypgraphy, by varying the above code slightly to something like
Code:
m ^HYPOX("XELCOL4")=XELCOL4
and
Code:
m XELCOL4=^HYPOX("XELCOL4")
I personally use a pretty jazzy little collection of utilities to keep a “library” of useful xecute code programs, which has automatic versioning, and basic shared subroutine loading features. It’s anybody’s for the asking, but I think it might be more than you need unless you begin seriously writing and/or managing xecute code programs.


----------------
Moderator: Computers and Technology; Medical Science; Science Projects and Homework; Philosophy of Science; Physics and Mathematics; Environmental Studies
Reply With Quote
 
» Advertisement
» Current Poll
Who's the sexiest man alive? Johnny Depp or Robert Pattinson?
Johnny Depp - 27.27%
3 Votes
Robert Pattinson - 0%
0 Votes
Someone else (please specify) - 45.45%
5 Votes
I'm too macho to think a guy is sexy - 27.27%
3 Votes
Total Votes: 11
You may not vote on this poll.


All times are GMT -8. The time now is 10:26 AM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000-2009 Hypography
Part of the Hypography - Science for Everyone Network