DonLaib
03-31-03, 01:54 PM
I am trying to input a text string which will be converted by CONVERT or NUMBER or FNUMBER later. I am not having much luck. Here is are the tests that I have done and the results.
\ Here is a way to input a counted string that works:
: GET_COUNTED$ ( -- a ) PAD 1+ 20 EXPECT SPAN @
PAD C! PAD ;
: TEST_GET_COUNTED$ ( a -- ) CR CR ." Enter a string: "
[COMPILE] GET_COUNTED$ CR CR
." Here is your string: " COUNT TYPE CR ;
TEST_GET_COUNTED$
\ Here is the result:
\ Enter a string: This is a string.
\ Here is your string: This is a string.
\ OK
FORGET TEST_GET_COUNTED$
FORGET GET_COUNTED$
: GET_COUNTED$ ( -- a ) 1 WORD ;
: TEST_GET_COUNTED$ ( a -- ) CR CR ." Enter a string: "
[COMPILE] GET_COUNTED$ CR CR
." Here is your string: " COUNT TYPE CR ;
TEST_GET_COUNTED$
\ Here is the result:
\ Enter a string:
\ Here is your string:
\ OK
\ Note: WORD did not try to enter a string. It seems to have just entered
\ a null string and run with \ it. I thought perhaps WORD is IMMEDIATE so I tried this:
FORGET TEST_GET_COUNTED$
FORGET GET_COUNTED$
: GET_COUNTED$ ( -- a ) 1 [COMPILE] WORD ;
: TEST_GET_COUNTED$ ( a -- ) CR CR ." Enter a string: "
[COMPILE] GET_COUNTED$ CR CR
." Here is your string: " COUNT TYPE CR ;
TEST_GET_COUNTED$
\ Here is the result:
\ Enter a string:
\ Here is your string:
\ OK
\ Note: [COMILE] did not change anything that I can tell.
\ UNCLE! I give up! How do I make this work?
BTW: If you try to send a comment line to the IsoPod via NMITerm by loading or pasting something
like:
\ test
you will get a error boxes that says:
NMITerm
Run-time error '-2147417848 (80010108)':
Automation error
The object invoked has disconnected from its clients.
followed by:
Program Error
NMITerm.exe has generated errors and will be closed by Windows.
You will need to restart the program.
An error log is being created.
I would not care too much except that when trying to learn a new system I like to create an
executeable test file like this one to document what I have tried. Not being able to load comment
likes complecates my procedures.
What am I doing wrong?
Don
\ Here is a way to input a counted string that works:
: GET_COUNTED$ ( -- a ) PAD 1+ 20 EXPECT SPAN @
PAD C! PAD ;
: TEST_GET_COUNTED$ ( a -- ) CR CR ." Enter a string: "
[COMPILE] GET_COUNTED$ CR CR
." Here is your string: " COUNT TYPE CR ;
TEST_GET_COUNTED$
\ Here is the result:
\ Enter a string: This is a string.
\ Here is your string: This is a string.
\ OK
FORGET TEST_GET_COUNTED$
FORGET GET_COUNTED$
: GET_COUNTED$ ( -- a ) 1 WORD ;
: TEST_GET_COUNTED$ ( a -- ) CR CR ." Enter a string: "
[COMPILE] GET_COUNTED$ CR CR
." Here is your string: " COUNT TYPE CR ;
TEST_GET_COUNTED$
\ Here is the result:
\ Enter a string:
\ Here is your string:
\ OK
\ Note: WORD did not try to enter a string. It seems to have just entered
\ a null string and run with \ it. I thought perhaps WORD is IMMEDIATE so I tried this:
FORGET TEST_GET_COUNTED$
FORGET GET_COUNTED$
: GET_COUNTED$ ( -- a ) 1 [COMPILE] WORD ;
: TEST_GET_COUNTED$ ( a -- ) CR CR ." Enter a string: "
[COMPILE] GET_COUNTED$ CR CR
." Here is your string: " COUNT TYPE CR ;
TEST_GET_COUNTED$
\ Here is the result:
\ Enter a string:
\ Here is your string:
\ OK
\ Note: [COMILE] did not change anything that I can tell.
\ UNCLE! I give up! How do I make this work?
BTW: If you try to send a comment line to the IsoPod via NMITerm by loading or pasting something
like:
\ test
you will get a error boxes that says:
NMITerm
Run-time error '-2147417848 (80010108)':
Automation error
The object invoked has disconnected from its clients.
followed by:
Program Error
NMITerm.exe has generated errors and will be closed by Windows.
You will need to restart the program.
An error log is being created.
I would not care too much except that when trying to learn a new system I like to create an
executeable test file like this one to document what I have tried. Not being able to load comment
likes complecates my procedures.
What am I doing wrong?
Don