Home » Archimedes archive » Acorn User » AU 1997-10 A.adf » Extras » Apple][e/PD/BOB/ARMBOB/!ArmBob/progs/h/hidden

Apple][e/PD/BOB/ARMBOB/!ArmBob/progs/h/hidden

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1997-10 A.adf » Extras
Filename: Apple][e/PD/BOB/ARMBOB/!ArmBob/progs/h/hidden
Read OK:
File size: 024F bytes
Load address: 0000
Exec address: 0000
File contents
/**************************************************** 
 *  Hidden input - returns input but only echoes the 
 *  character c for each input character. Useful
 *  for passwords.    GCW 02/03/94
 ***************************************************/

hidden_input(c)
{
 local r,buf;
 r = newvector(8);
 buf = @(newstring(64));
 r[0] = buf+(1<<30)+(1<<31);
 r[1] = 64;     /* length of buffer           */
 r[2] = 32;     /* lowest character accepted  */
 r[3] = 126;    /* highest character accepted */
 r[4] = c;      /* echo character             */
 swi("OS_ReadLine",r);
 return($(buf));
}
00000000  2f 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |/***************|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000030  2a 2a 2a 2a 2a 20 0a 20  2a 20 20 48 69 64 64 65  |***** . *  Hidde|
00000040  6e 20 69 6e 70 75 74 20  2d 20 72 65 74 75 72 6e  |n input - return|
00000050  73 20 69 6e 70 75 74 20  62 75 74 20 6f 6e 6c 79  |s input but only|
00000060  20 65 63 68 6f 65 73 20  74 68 65 20 0a 20 2a 20  | echoes the . * |
00000070  20 63 68 61 72 61 63 74  65 72 20 63 20 66 6f 72  | character c for|
00000080  20 65 61 63 68 20 69 6e  70 75 74 20 63 68 61 72  | each input char|
00000090  61 63 74 65 72 2e 20 55  73 65 66 75 6c 0a 20 2a  |acter. Useful. *|
000000a0  20 20 66 6f 72 20 70 61  73 73 77 6f 72 64 73 2e  |  for passwords.|
000000b0  20 20 20 20 47 43 57 20  30 32 2f 30 33 2f 39 34  |    GCW 02/03/94|
000000c0  0a 20 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |. **************|
000000d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000000f0  2a 2a 2a 2a 2a 2f 0a 0a  68 69 64 64 65 6e 5f 69  |*****/..hidden_i|
00000100  6e 70 75 74 28 63 29 0a  7b 0a 20 6c 6f 63 61 6c  |nput(c).{. local|
00000110  20 72 2c 62 75 66 3b 0a  20 72 20 3d 20 6e 65 77  | r,buf;. r = new|
00000120  76 65 63 74 6f 72 28 38  29 3b 0a 20 62 75 66 20  |vector(8);. buf |
00000130  3d 20 40 28 6e 65 77 73  74 72 69 6e 67 28 36 34  |= @(newstring(64|
00000140  29 29 3b 0a 20 72 5b 30  5d 20 3d 20 62 75 66 2b  |));. r[0] = buf+|
00000150  28 31 3c 3c 33 30 29 2b  28 31 3c 3c 33 31 29 3b  |(1<<30)+(1<<31);|
00000160  0a 20 72 5b 31 5d 20 3d  20 36 34 3b 20 20 20 20  |. r[1] = 64;    |
00000170  20 2f 2a 20 6c 65 6e 67  74 68 20 6f 66 20 62 75  | /* length of bu|
00000180  66 66 65 72 20 20 20 20  20 20 20 20 20 20 20 2a  |ffer           *|
00000190  2f 0a 20 72 5b 32 5d 20  3d 20 33 32 3b 20 20 20  |/. r[2] = 32;   |
000001a0  20 20 2f 2a 20 6c 6f 77  65 73 74 20 63 68 61 72  |  /* lowest char|
000001b0  61 63 74 65 72 20 61 63  63 65 70 74 65 64 20 20  |acter accepted  |
000001c0  2a 2f 0a 20 72 5b 33 5d  20 3d 20 31 32 36 3b 20  |*/. r[3] = 126; |
000001d0  20 20 20 2f 2a 20 68 69  67 68 65 73 74 20 63 68  |   /* highest ch|
000001e0  61 72 61 63 74 65 72 20  61 63 63 65 70 74 65 64  |aracter accepted|
000001f0  20 2a 2f 0a 20 72 5b 34  5d 20 3d 20 63 3b 20 20  | */. r[4] = c;  |
00000200  20 20 20 20 2f 2a 20 65  63 68 6f 20 63 68 61 72  |    /* echo char|
00000210  61 63 74 65 72 20 20 20  20 20 20 20 20 20 20 20  |acter           |
00000220  20 20 2a 2f 0a 20 73 77  69 28 22 4f 53 5f 52 65  |  */. swi("OS_Re|
00000230  61 64 4c 69 6e 65 22 2c  72 29 3b 0a 20 72 65 74  |adLine",r);. ret|
00000240  75 72 6e 28 24 28 62 75  66 29 29 3b 0a 7d 0a     |urn($(buf));.}.|
0000024f