manual:chapter4:dirs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:chapter4:dirs [2017/05/11 15:25]
claudio
manual:chapter4:dirs [2017/06/04 04:07] (current)
pier4r [Directories]
Line 1: Line 1:
 =====Directories and variable storage===== =====Directories and variable storage=====
-----+
 ====Directories==== ====Directories====
  
 Directories are containers for storing any other type of object (a variable, list, or another directory).  One can think of them as forming a filesystem like on any computer.  The root directory is defined to be **HOME**, which is the current directory when the newRPL system is initially booted.  Creating and deleting directories (known as subdirectories) within **HOME** is accomplished with the ''CRDIR'' (create directory) and ''PGDIR'' (purge directory) commands. Directories are containers for storing any other type of object (a variable, list, or another directory).  One can think of them as forming a filesystem like on any computer.  The root directory is defined to be **HOME**, which is the current directory when the newRPL system is initially booted.  Creating and deleting directories (known as subdirectories) within **HOME** is accomplished with the ''CRDIR'' (create directory) and ''PGDIR'' (purge directory) commands.
  
-As an example, this creates the subdirectory TEST from the current working directory:+As an example, this creates the subdirectory TEST from the current working directory:  '' 'TEST' CRDIR''
  
-<code>'TEST' CRDIR</code>+The directory name is enclosed in single quotes (as opposed to strings that use double-quotes as delimiters).  Now the TEST subdirectory shows up as an object in the soft menus.  Selecting it enters that directory, and the current directory path is displayed in the status area.  To move back up to the parent directory, use the command ''UPDIR'' Anywhere in the directory tree executing ''HOME'' will return the user to the root or HOME directory.   
 + 
 +To delete a directory, use the command ''PGDIR''.  **Note that this command will delete the directory and all subdirectories, so use it carefully**, especially if there are variables stored in the directory as currently there is no confirmation for purging non-empty directories.
  
-The directory name is enclosed in single quotes (as opposed to strings that use double-quotes as delimiters).  Now the TEST subdirectory shows up as an object in the soft menus.  Selecting it enters that directory, and the current directory path is displayed in the status area.  To move back up to the parent directory, use the command ''UPDIR'' Anywhere in the directory tree executing ''HOME'' will return the user to the root or HOME directory.  To delete a directory, use the command ''PGDIR'' **Note that this command will delete the directory and all subdirectories, so use it carefully, especially if there are variables stored in the directory as currently there is no confirmation for purging non-empty directories.** 
 ---- ----
 +
 ====Variable Storage==== ====Variable Storage====
  
 Storing objects, or variables, within a directory is accomplished with the ''STO'' and ''RCL'' commands. Storing objects, or variables, within a directory is accomplished with the ''STO'' and ''RCL'' commands.
  
-For example:+For example: ''42 'Mynum' STO''
  
-<code>42 'Mynum' STO</code> +will store the number 42 into the named variable 'Mynum', and to recall this newly created variable to the stack either press the corresponding soft menu key or, '' 'Mynum' RCL''
- +
-will store the number 42 into the named variable 'Mynum', and to recall this newly created variable to the stack either press the corresponding soft menu key or, +
- +
-<code>'Mynum' RCL</code>+
  
 To delete a variable, use the command ''PURGE'' with the variable name in single quotes on the stack. To delete a variable, use the command ''PURGE'' with the variable name in single quotes on the stack.
Line 27: Line 25:
 There are two other ways to quickly store/recall variables: There are two other ways to quickly store/recall variables:
  
-1.  Use the dedicated store and recall keys, which are now mapped to the ''HIST'' and ''LS-HIST'' keys, respectively.  So, to store the number 42 as above, put 42 and 'Mynum' on the first two levels of the stack and press ''HIST''.  To recall the number, simply put 'Mynum' on the stack and press ''LS-HIST''.+1.  Use the dedicated store and recall keys, which are now mapped to the **M** and **LS-M** keys, respectively.  So, to store the number 42 as above, put 42 and 'Mynum' on the first two levels of the stack and press **M**.  To recall the number, simply put 'Mynum' on the stack and press **LS-M**. 
 + 
 +2.  Use the shortcut keys for moving variable contents into and out of soft menu key assignments: **RS-{A..L}** recalls the variable to the stack, and **LS-{A..L}** stores the contents of stack level 1 to the soft Menukey.  //Note that it can be easy to make a mistake using this last method and wipe out the variable (or, more generally, any object) stored in a soft menu key.  This becomes particularly dangerous when storing whole programs since they can be inadvertently lost if the wrong shortcut key is used.  However, newRPL has a built-in way to protect variables with the command// ''LOCKVAR''.
  
-2.  Use the shortcut keys for moving variable contents into and out of soft menu key assignments: ''RS-Menukey'' recalls the variable to the stack, and ''LS-Menukey'' stores the contents of stack level 1 to the soft Menukey.  //Note that it can be easy to make a mistake using this last method and wipe out the variable (or, more generally, any object) stored in a soft menu key.  This becomes particularly dangerous when storing whole programs since they can be inadvertently lost if the wrong shortcut key is used.  However, newRPL has a built-in way to protect variables with the command// ''LOCKVAR''. 
 ---- ----
 +
 ====Special Variable Commands==== ====Special Variable Commands====
  
Line 42: Line 42:
  
 ''UNHIDEVAR'', variable is made visible in soft menu ''UNHIDEVAR'', variable is made visible in soft menu
 +
 +----
  • manual/chapter4/dirs.1494541541.txt.gz
  • Last modified: 2017/05/11 15:25
  • by claudio