help 
Author Message
 help

I am having  trouble with a program I am writing to display a vertical menu
and moves a reverse video bar up and down across the menu choice when the
user presses an arrow on the keyboard.


Sun, 03 Nov 2002 03:00:00 GMT  
 help


   >I am having  trouble with a program I am writing to display a
   >vertical menu and moves a reverse video bar up and down across the
   >menu choice when the user presses an arrow on the keyboard.

Certainly sorry to hear about your troubles.  It's a gosh-darn
shame.  Those 'light-bar' menus can be a real {*filter*}, can't they?

Perhaps if you would outline =specifically= the problem you're
experiencing -- and also POST THE CODE that you've written so
that we can see precisely what you're doing -- then maybe some-
one here in the newsgroup might have some ideas or insights that
could prove helpful in ameliorating your troubles.

Until such time as that occurs, about all we can do is send you
our condolences, and hope that things get better for you real soon.



Sun, 03 Nov 2002 03:00:00 GMT  
 help
I am having  trouble with a program I am writing to display a
vertical menu and moves a reverse video bar up and down across the
menu choice when the user presses an arrow on the keyboard.

title Chapter 6 - Question 2
.model small
.stack 100h

UP_ARROW = 48h
DOWN_ARROW =  50h

.data

.code
include library.inc
main proc

mov ds,ax
call clrscr
mov al,1
mov bh,70h
mov ch,0
mov cl,0
mov dh,1
mov dl,12

L1:
call GetArrow
cmp ax,0
je Quit
jmp L1

Quit:
mov ax,4c00h
int 21h
main endp

GetArrow proc
mov ah,10h
int 16h

UP_SCAN:
cmp ah,UP_ARROW
jne DOWN_SCAN
mov ax,1                ; AX =1= UP ARROW
jmp L2
DOWN_SCAN:
cmp ah,DOWN_ARROW
jne NO_SCAN
mov ax,3
jmp L2                ; AX =3= DOWN ARROW
NO_SCAN:
jmp L2

L2:                     ; COMPARE RESULT, OUTPUT MESSAGE
cmp ax,1
jne l3
mov ah,6
sub dh,1
sub ch,1
mov bh,70h
int 10h
mov bh,7
jmp last
l3:
cmp ax,3
jne l0
mov ah,7
inc ch
inc dh
mov bh,70h
jmp last
l0:
ret
last:
int 10h
ret
GetArrow endp

end main



Mon, 04 Nov 2002 03:00:00 GMT  
 help

Quote:

> I am having  trouble with a program I am writing to display a
> vertical menu and moves a reverse video bar up and down across the
> menu choice when the user presses an arrow on the keyboard.

    When you first posted, without the code, I guessed that detecting
the arrow keys might be your problem, but you've got the general idea of
that right. You'll want to detect the enter key, too (I assume), and
maybe the escape key (?). I would check to see if al is zero before
checking ah for the arrow key - some other key *might* give that
scan-code in ah.

    My other thought (without the code) was that, of course you don't
really "move" the inverse video bar - what you need to do is display
your "options" (at a specified row/column), with one of them (the
default option) inversed. When an arrow key is detected, reprint the
current option in regular video, and reprint the next or previous option
in inverse video - then go back and get another key, repeating this loop
until enter is pressed. You'll want to think about what to do at the
"top" or "bottom" - "roll over" or just stop - don't go out-of-range!

    Your code uses the "scroll" function, which suggests you're trying
to "move" the "light bar". You might be able to get this to work -
moving the desired attribute under the desired option and then
re-printing it - but I think you'll find it's the hard way. Maybe not, I
haven't tried it.

    There's considerable controversy about what makes code "readable",
but I don't think I'll get *too* much argument with the suggestion that
almost anything is better than a lower-case letter "l" and a digit for a
label name :)

Best,
Frank

Quote:

> title Chapter 6 - Question 2
> .model small
> .stack 100h

> UP_ARROW = 48h
> DOWN_ARROW =  50h

> .data

> .code
> include library.inc
> main proc

> mov ds,ax
> call clrscr
> mov al,1
> mov bh,70h
> mov ch,0
> mov cl,0
> mov dh,1
> mov dl,12

> L1:
> call GetArrow
> cmp ax,0
> je Quit
> jmp L1

> Quit:
> mov ax,4c00h
> int 21h
> main endp

> GetArrow proc
> mov ah,10h
> int 16h

> UP_SCAN:
> cmp ah,UP_ARROW
> jne DOWN_SCAN
> mov ax,1                ; AX =1= UP ARROW
> jmp L2
> DOWN_SCAN:
> cmp ah,DOWN_ARROW
> jne NO_SCAN
> mov ax,3
> jmp L2                ; AX =3= DOWN ARROW
> NO_SCAN:
> jmp L2

> L2:                     ; COMPARE RESULT, OUTPUT MESSAGE
> cmp ax,1
> jne l3
> mov ah,6
> sub dh,1
> sub ch,1
> mov bh,70h
> int 10h
> mov bh,7
> jmp last
> l3:
> cmp ax,3
> jne l0
> mov ah,7
> inc ch
> inc dh
> mov bh,70h
> jmp last
> l0:
> ret
> last:
> int 10h
> ret
> GetArrow endp

> end main



Mon, 04 Nov 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. help! f90.help help help help

2. ***HELP***HELP***NEED INFORMATION***HELP***HELP

3. HELP HELP HELP HELP

4. HELP HELP HELP HELP

5. Ord Function HELP Please HELP HELP HELP

6. help help help help!!!!!!!!!!!

7. (HELP (HELP (HELP (HELP))))

8. HELP: HELP: HELP: HELP: Online-manual on Expect

9. Help Help Help

10. TopSpeed - ODBC 3.1???? HELP HELP HELP

11. HELP - HELP - HELP

12. HELP HELP HELP - round function error

 

 
Powered by phpBB® Forum Software