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/09 19:09]
smartin
manual:chapter4:dirs [2017/06/04 04:07] (current)
pier4r [Directories]
Line 1: Line 1:
-====Directories and variable storage====+=====Directories and variable storage=====
  
-Directories ​are so-called '​pseudo-objects'​ that are simply 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====
  
-As an examplethis creates the subdirectory TEST from the current ​working ​directory:+Directories are containers for storing any other type of object (a variablelist, 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.
  
-<​code>​'​TEST'​ CRDIR</​code>​+As an example, this creates the subdirectory TEST from the current working directory: ​ '' ​'​TEST'​ CRDIR''​
  
-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.  ​
  
-Storing objects, or variables, within ​a directory ​is accomplished with the ''​STO''​ and ''​RCL''​ commands.+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.
  
-For example:+----
  
-<​code>​42 '​Mynum'​ STO</​code>​+====Variable Storage====
  
-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,+Storing objects, or variables, within a directory is accomplished with the ''​STO'' ​and ''​RCL''​ commands.
  
-<​code>​'​Mynum'​ RCL</​code>​+For example: ''​42 '​Mynum'​ STO''​ 
 + 
 +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''​ 
 + 
 +To delete a variable, use the command ''​PURGE''​ with the variable name in single quotes on the stack.
  
 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''​. 
 + 
 +---- 
 + 
 +====Special Variable Commands==== 
 + 
 +The following commands are useful for adding special characteristics to a variable (for each command the variable name should be in single quotes on the stack):
  
-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.+''​LOCKVAR''​, mark variable ​as //read-only//
  
 +''​UNLOCKVAR'',​ mark variable as normal read or write
  
 +''​HIDEVAR'',​ variable will not be visible in soft menu (but still is accessible by ''​EVAL''​ on variable name in single quotes)
  
 +''​UNHIDEVAR'',​ variable is made visible in soft menu
  
 +----
  • manual/chapter4/dirs.1494382152.txt.gz
  • Last modified: 2017/05/09 19:09
  • by smartin