Post Reply 
(50g) Store calculation result in different directory
06-07-2015, 03:05 AM
Post: #5
RE: (50g) Store calculation result in different directory
(06-06-2015 03:32 PM)peacecalc Wrote:  It's bit tricky:
For storing: value 5 should be stored in the variable A in the subdirectory dirsubsub:

first step
stack 1: {dirsub dirsubsub} EVAL @@changes current directory to dirsubsub

second step
stack 2: 5
stack 1: 'A' STO

third step
UPDIR UPDIR @@changes back to former directory

that is clumsy maybe someone else know a more comfortable way. If you want to store in upper directories, then change step 1 with step 3.

Instead of
{dirsub dirsubsub} EVAL 5 'A' STO UPDIR UPDIR
I would suggest
PATH dirsub dirsubsub 5 'A' STO EVAL

Two things to notice here. (1) To jump into a directory, just say its name. No need to put it in a list and EVAL the list. If name ambiguity is possible, execute HOME before the first directory name. (2) You can return to your original path at any time, no matter what path changes you've made, by starting with PATH, and ending with EVAL, because that executes (and therefore restores) the original path. No need for multiple UPDIR's.

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: (50g) Store calculation result in different directory - Joe Horn - 06-07-2015 03:05 AM

User(s) browsing this thread: 1 Guest(s)