EXECUTE / IN strangeness

51 views
Skip to first unread message

Lawrence J. Rizzo

unread,
Mar 20, 2012, 2:52:20 PM3/20/12
to jb...@googlegroups.com
Hello,

I am experiencing an issue on a Windows 2003 server running jBase 3.4.7. It
seems if I use the EXECUTE statement to do something at the operating system
level that I am getting strange results on my "IN" commands to read the
keyboard.

I have isolated the issue and am able to reproduce it with the two listings,
below. In listing #1 I am getting the correct responses, which are
equivalents for the arrow keys and the escape key. In program listing #2,
by appending the CHAR(255):'k', the programming no longer returns the
correct results.

Any assistance would be greatly appreciated!

Thanks,
Larry


Program listing #1.
001 ***EXECUTE CHAR(255):'k':'CLS' CAPTURING JUNK
002 EXECUTE 'CLS' CAPTURING JUNK
003
004 10 CALL SINGLE.CHAR.INPUT.JBASE (KEY$)
005
006 CRT KEY$
007
008 IF KEY$ = '<ESC>' THEN STOP ELSE GO 10

RUN:
jsh CI E:\cubs\ci\data -->IN.TEST
<UP>
<DOWN>
<RIGHT>
<LEFT>
<ESC>


Program listing #2.
001 EXECUTE CHAR(255):'k':'CLS' CAPTURING JUNK
002 ***EXECUTE 'CLS' CAPTURING JUNK
003
004 10 CALL SINGLE.CHAR.INPUT.JBASE (KEY$)
005
006 CRT KEY$
007
008 IF KEY$ = '<ESC>' THEN STOP ELSE GO 10

RUN:
jsh CI E:\cubs\ci\data -->IN.TEST
[A

[C


SINGLE.CHAR.INPUT.JBASE listing:
SUBROUTINE SINGLE.CHAR.INPUT.JBASE (KEY$)

$INCLUDE JBC.h
$INCLUDE jCmdKeys.h

CALL CommandInit

ECHO OFF
CALL CommandNext(RtnNo, KeyData, 0)
ECHO ON

BEGIN CASE
*
** ESCAPE
*
CASE RtnNo = cmd_escape
KEY$ = '<ESC>'
*
** ARROW KEYS
*
CASE RtnNo = cmd_cursor_up ;* Move cursor up a line
KEY$ = '<UP>'
CASE RtnNo = cmd_cursor_down ;* Move cursor down a line
KEY$ = '<DOWN>'
CASE RtnNo = cmd_cursor_right ;* Move cursor to the right
KEY$ = '<RIGHT>'
CASE RtnNo = cmd_cursor_left ;* Move cursor to the left
KEY$ = '<LEFT>'
*
** CTRL CHARACTERS
*
CASE RtnNo = cmd_start_line
KEY$ = '<CTRL-A>'
CASE RtnNo = cmd_end_line
KEY$ = '<CTRL-E>'
CASE RtnNo = 'D'
KEY$ = '<CTRL-D>'
CASE RtnNo = 36
KEY$ = '<CTRL-H>'
*
** REGULAR CHARACTERS
*
CASE RtnNo = cmd_alpha_numeric ;* Simple alpha-numeric
KEY$ = KeyData
CASE 1
END CASE
*
RETURN

code24 code

unread,
Mar 29, 2012, 5:59:06 AM3/29/12
to jb...@googlegroups.com
what do you want to achieve?


--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.

To post, send email to jB...@googlegroups.com
To unsubscribe, send email to jBASE-un...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

Reply all
Reply to author
Forward
0 new messages