Home » Archimedes archive » Acorn User » AU 1996-03 B.adf » Features » Vocabulary/Source/redraw

Vocabulary/Source/redraw

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 1996-03 B.adf » Features
Filename: Vocabulary/Source/redraw
Read OK:
File size: 0480 bytes
Load address: 0000
Exec address: 0000
File contents
#include "inc.h"

extern dbox edit;
extern dbox wrong;
extern char german[170][40];
extern char english[170][40];
extern char wrong_word_english[170][40];
extern char wrong_word_german[170][40];
extern int addon1;
extern int addon2;
extern char title[70];
extern char subtitle[70];
extern char language[70];

void redraw_edit(void)
{
int ze = 1;



    while (ze<10)
    {
    dbox_setnumeric(edit,ze,ze+addon1);
  
    ze++;
    }

    while (ze<19)
    {
    dbox_setfield(edit,ze,english[ze-10+addon1]);
    ze++;
    }

    while (ze<28)
    {
    dbox_setfield(edit,ze,german[ze-19+addon1]);
    ze++;
    }

dbox_setfield(edit,30,title);
dbox_setfield(edit,0,subtitle);
dbox_setfield(edit,31,language);
dbox_setfield(edit,34,language);
}




void redraw_wrong(void)
{
int ze = 1;

while (ze<10)
{
dbox_setnumeric(wrong,ze,ze+addon2);
ze++;
}

while (ze<19)
{
dbox_setfield(wrong,ze,wrong_word_english[ze-10+addon2]);
ze++;
}

while (ze<28)
{
dbox_setfield(wrong,ze,wrong_word_german[ze-19+addon2]);
ze++;
}
dbox_setfield(wrong,30,title);
dbox_setfield(wrong,0,subtitle);
dbox_setfield(wrong,28,language);
dbox_setfield(wrong,34,language);
}




00000000  0a 23 69 6e 63 6c 75 64  65 20 22 69 6e 63 2e 68  |.#include "inc.h|
00000010  22 0a 0a 65 78 74 65 72  6e 20 64 62 6f 78 20 65  |"..extern dbox e|
00000020  64 69 74 3b 0a 65 78 74  65 72 6e 20 64 62 6f 78  |dit;.extern dbox|
00000030  20 77 72 6f 6e 67 3b 0a  65 78 74 65 72 6e 20 63  | wrong;.extern c|
00000040  68 61 72 20 67 65 72 6d  61 6e 5b 31 37 30 5d 5b  |har german[170][|
00000050  34 30 5d 3b 0a 65 78 74  65 72 6e 20 63 68 61 72  |40];.extern char|
00000060  20 65 6e 67 6c 69 73 68  5b 31 37 30 5d 5b 34 30  | english[170][40|
00000070  5d 3b 0a 65 78 74 65 72  6e 20 63 68 61 72 20 77  |];.extern char w|
00000080  72 6f 6e 67 5f 77 6f 72  64 5f 65 6e 67 6c 69 73  |rong_word_englis|
00000090  68 5b 31 37 30 5d 5b 34  30 5d 3b 0a 65 78 74 65  |h[170][40];.exte|
000000a0  72 6e 20 63 68 61 72 20  77 72 6f 6e 67 5f 77 6f  |rn char wrong_wo|
000000b0  72 64 5f 67 65 72 6d 61  6e 5b 31 37 30 5d 5b 34  |rd_german[170][4|
000000c0  30 5d 3b 0a 65 78 74 65  72 6e 20 69 6e 74 20 61  |0];.extern int a|
000000d0  64 64 6f 6e 31 3b 0a 65  78 74 65 72 6e 20 69 6e  |ddon1;.extern in|
000000e0  74 20 61 64 64 6f 6e 32  3b 0a 65 78 74 65 72 6e  |t addon2;.extern|
000000f0  20 63 68 61 72 20 74 69  74 6c 65 5b 37 30 5d 3b  | char title[70];|
00000100  0a 65 78 74 65 72 6e 20  63 68 61 72 20 73 75 62  |.extern char sub|
00000110  74 69 74 6c 65 5b 37 30  5d 3b 0a 65 78 74 65 72  |title[70];.exter|
00000120  6e 20 63 68 61 72 20 6c  61 6e 67 75 61 67 65 5b  |n char language[|
00000130  37 30 5d 3b 0a 0a 76 6f  69 64 20 72 65 64 72 61  |70];..void redra|
00000140  77 5f 65 64 69 74 28 76  6f 69 64 29 0a 7b 0a 69  |w_edit(void).{.i|
00000150  6e 74 20 7a 65 20 3d 20  31 3b 0a 0a 0a 0a 20 20  |nt ze = 1;....  |
00000160  20 20 77 68 69 6c 65 20  28 7a 65 3c 31 30 29 0a  |  while (ze<10).|
00000170  20 20 20 20 7b 0a 20 20  20 20 64 62 6f 78 5f 73  |    {.    dbox_s|
00000180  65 74 6e 75 6d 65 72 69  63 28 65 64 69 74 2c 7a  |etnumeric(edit,z|
00000190  65 2c 7a 65 2b 61 64 64  6f 6e 31 29 3b 0a 20 20  |e,ze+addon1);.  |
000001a0  0a 20 20 20 20 7a 65 2b  2b 3b 0a 20 20 20 20 7d  |.    ze++;.    }|
000001b0  0a 0a 20 20 20 20 77 68  69 6c 65 20 28 7a 65 3c  |..    while (ze<|
000001c0  31 39 29 0a 20 20 20 20  7b 0a 20 20 20 20 64 62  |19).    {.    db|
000001d0  6f 78 5f 73 65 74 66 69  65 6c 64 28 65 64 69 74  |ox_setfield(edit|
000001e0  2c 7a 65 2c 65 6e 67 6c  69 73 68 5b 7a 65 2d 31  |,ze,english[ze-1|
000001f0  30 2b 61 64 64 6f 6e 31  5d 29 3b 0a 20 20 20 20  |0+addon1]);.    |
00000200  7a 65 2b 2b 3b 0a 20 20  20 20 7d 0a 0a 20 20 20  |ze++;.    }..   |
00000210  20 77 68 69 6c 65 20 28  7a 65 3c 32 38 29 0a 20  | while (ze<28). |
00000220  20 20 20 7b 0a 20 20 20  20 64 62 6f 78 5f 73 65  |   {.    dbox_se|
00000230  74 66 69 65 6c 64 28 65  64 69 74 2c 7a 65 2c 67  |tfield(edit,ze,g|
00000240  65 72 6d 61 6e 5b 7a 65  2d 31 39 2b 61 64 64 6f  |erman[ze-19+addo|
00000250  6e 31 5d 29 3b 0a 20 20  20 20 7a 65 2b 2b 3b 0a  |n1]);.    ze++;.|
00000260  20 20 20 20 7d 0a 0a 64  62 6f 78 5f 73 65 74 66  |    }..dbox_setf|
00000270  69 65 6c 64 28 65 64 69  74 2c 33 30 2c 74 69 74  |ield(edit,30,tit|
00000280  6c 65 29 3b 0a 64 62 6f  78 5f 73 65 74 66 69 65  |le);.dbox_setfie|
00000290  6c 64 28 65 64 69 74 2c  30 2c 73 75 62 74 69 74  |ld(edit,0,subtit|
000002a0  6c 65 29 3b 0a 64 62 6f  78 5f 73 65 74 66 69 65  |le);.dbox_setfie|
000002b0  6c 64 28 65 64 69 74 2c  33 31 2c 6c 61 6e 67 75  |ld(edit,31,langu|
000002c0  61 67 65 29 3b 0a 64 62  6f 78 5f 73 65 74 66 69  |age);.dbox_setfi|
000002d0  65 6c 64 28 65 64 69 74  2c 33 34 2c 6c 61 6e 67  |eld(edit,34,lang|
000002e0  75 61 67 65 29 3b 0a 7d  0a 0a 0a 0a 0a 76 6f 69  |uage);.}.....voi|
000002f0  64 20 72 65 64 72 61 77  5f 77 72 6f 6e 67 28 76  |d redraw_wrong(v|
00000300  6f 69 64 29 0a 7b 0a 69  6e 74 20 7a 65 20 3d 20  |oid).{.int ze = |
00000310  31 3b 0a 0a 77 68 69 6c  65 20 28 7a 65 3c 31 30  |1;..while (ze<10|
00000320  29 0a 7b 0a 64 62 6f 78  5f 73 65 74 6e 75 6d 65  |).{.dbox_setnume|
00000330  72 69 63 28 77 72 6f 6e  67 2c 7a 65 2c 7a 65 2b  |ric(wrong,ze,ze+|
00000340  61 64 64 6f 6e 32 29 3b  0a 7a 65 2b 2b 3b 0a 7d  |addon2);.ze++;.}|
00000350  0a 0a 77 68 69 6c 65 20  28 7a 65 3c 31 39 29 0a  |..while (ze<19).|
00000360  7b 0a 64 62 6f 78 5f 73  65 74 66 69 65 6c 64 28  |{.dbox_setfield(|
00000370  77 72 6f 6e 67 2c 7a 65  2c 77 72 6f 6e 67 5f 77  |wrong,ze,wrong_w|
00000380  6f 72 64 5f 65 6e 67 6c  69 73 68 5b 7a 65 2d 31  |ord_english[ze-1|
00000390  30 2b 61 64 64 6f 6e 32  5d 29 3b 0a 7a 65 2b 2b  |0+addon2]);.ze++|
000003a0  3b 0a 7d 0a 0a 77 68 69  6c 65 20 28 7a 65 3c 32  |;.}..while (ze<2|
000003b0  38 29 0a 7b 0a 64 62 6f  78 5f 73 65 74 66 69 65  |8).{.dbox_setfie|
000003c0  6c 64 28 77 72 6f 6e 67  2c 7a 65 2c 77 72 6f 6e  |ld(wrong,ze,wron|
000003d0  67 5f 77 6f 72 64 5f 67  65 72 6d 61 6e 5b 7a 65  |g_word_german[ze|
000003e0  2d 31 39 2b 61 64 64 6f  6e 32 5d 29 3b 0a 7a 65  |-19+addon2]);.ze|
000003f0  2b 2b 3b 0a 7d 0a 64 62  6f 78 5f 73 65 74 66 69  |++;.}.dbox_setfi|
00000400  65 6c 64 28 77 72 6f 6e  67 2c 33 30 2c 74 69 74  |eld(wrong,30,tit|
00000410  6c 65 29 3b 0a 64 62 6f  78 5f 73 65 74 66 69 65  |le);.dbox_setfie|
00000420  6c 64 28 77 72 6f 6e 67  2c 30 2c 73 75 62 74 69  |ld(wrong,0,subti|
00000430  74 6c 65 29 3b 0a 64 62  6f 78 5f 73 65 74 66 69  |tle);.dbox_setfi|
00000440  65 6c 64 28 77 72 6f 6e  67 2c 32 38 2c 6c 61 6e  |eld(wrong,28,lan|
00000450  67 75 61 67 65 29 3b 0a  64 62 6f 78 5f 73 65 74  |guage);.dbox_set|
00000460  66 69 65 6c 64 28 77 72  6f 6e 67 2c 33 34 2c 6c  |field(wrong,34,l|
00000470  61 6e 67 75 61 67 65 29  3b 0a 7d 0a 0a 0a 0a 0a  |anguage);.}.....|
00000480