PDA

View Full Version : Solved PropForth V5.0 problems



Duane C. Johnson
03-30-2012, 03:53 PM
I have been trying to get PropForth V5.0 running on my basic plug boards.
I have 64K eeprom, and SD-card on alternate pins [25...22].

After installing "PropForthDevKernel" things seemed to work OK.
I started going through the examples in the PropForthDoc, things worked OK until I got to a word containing c".
UNDEFINED WORD c” error occurs.
Then I check to see if c" exists by usind words and there it is 09_812 FIX c".

After checking there are lots of words that don't work even though they seem to be in the dictionary.

What is going on? What am I doing wrong?

Duane J

prof_braino
03-30-2012, 04:40 PM
The word
c" means "take following character from the input stream until the next " (double quote) and buffer them for a literal string.
The c" and the " must be bounded by white space, usually one or more blank spaces.
I think the c" only works inside a definition, it has to be in a wordthat starts with : and ends with ;

Can you post the bit that gives you the problem so I can try to reproduce it?

We tested the snot out of this, I would feel very bad if this is broken.

Duane C. Johnson
03-30-2012, 05:06 PM
Sure. its right out of the PropForthDoc.



Prop0 Cog6 RESET - last status: 0 ok
Prop0 Cog6 ok
sc c” Hello world” cr st? cr .cstr cr st?
0 items cleared
UNDEFINED WORD c”
Prop0 Cog6 ok
sc 1 0 st? cr <> . cr cr 1 1 st? cr <> . cr cr 0 -1 st? cr <> . cr cr
0 items cleared
ST: 0_000_000_001 0_000_000_000

-1

ST: 0_000_000_001 0_000_000_001

0

ST: 0_000_000_000 -0_000_000_001

-1

Prop0 Cog6 ok


Yes, there was white space.
I also show the example that works.

Duane J

prof_braino
03-30-2012, 06:11 PM
This is what I did using PropForthDevKernel.spin, and it looks like is works:



: test c" Hello Duane" cr .cstr cr st? ;


: test c" Hello Duane" cr .cstr cr st? ;
Prop0 Cog6 ok
test

Hello Duane
ST: 0_000_014_145
Prop0 Cog6 ok

Prop0 Cog6 ok
c" Hello Duane" cr .cstr

Hello DuaneProp0 Cog6 ok

What did you load onto the prop?

Duane C. Johnson
03-30-2012, 07:02 PM
I got it, IGOT IT!!

I was lazy and simply cut and pasted from "PropForthDoc".
However, that document employs ” (slanted or curly quote?) which is a character not even on my keyboard.
The correct character is the " (normal strait quote) which is on my keyboard.
Apparently there is a difference.

Bingo, now it works.

Apparently the html document did a switcheroo in the text so one can't directly cut and paste from it.
Maybe the document needs to be edited.
I can do it, actually I already did. Do you want a copy?

Duane J

Duane C. Johnson
03-30-2012, 08:24 PM
I found another one.

There is a difference between a DASH – and a MINUS -

I replaced all DASHs with MINUSs.

Duane J

prof_braino
03-31-2012, 03:43 PM
However, that document employs ” (slanted or curly quote?) which is a character not even on my keyboard.
The correct character is the " (normal strait quote) which is on my keyboard.
Do you want a copy?


We (the forth team) use only standard cheap off the shelf equipment, so we shouldn't have weird characters on the key board.
The docs were written with text copied from the screen, so now we have to figure out where they got switched.
I think something is the tool chain is giving "extra help" in efforts to meet or exceed customer expectations. Which always is annoying.

IF I could impose on you, could you please tell me so I can open a ticket:
1) OS and PC you are using
2) application used to open PropForth.HTML
3) the characters you found that are mis-translated (if there are more after " and -)
4) the terminal program you use to talk to the prop

If I can reproduce the error, I might be able to figure out who is the culprit and take appropriate action. Otherwise I will put in a note about not being able to copy the examples, which would not be the best.

Mike Green
03-31-2012, 04:36 PM
Microsoft Word makes these substitutions by default.

mindrobots
03-31-2012, 05:03 PM
What Mike said. It's the joy of document processing. Technically, there are opening and closing quotes. Options are to possibly find a font for examples that only has single and double quotes, and/or set up a paragraph style for examples that doesn't automatically "fix" quotes....or use a text editor instead of a word processor for examples.

prof_braino
03-31-2012, 05:20 PM
I was afraid you'd say something like this.

The first work around will be a note that states the examples can't always be copied due to these changes.

Any hints or references for setting a font that doesn't misbehave?
What about Open Office as editor?

I don't want ask Sal to edit the docs twice, or to add html tags by hand.

OPened issue 145 on this. Thanks Duane and everybody!

http://code.google.com/p/propforth/issues/detail?id=145

mindrobots
03-31-2012, 05:57 PM
If I get a chance this evening, during TV time, I'll try to find a solution with Word or OpenOffice.

Duane C. Johnson
03-31-2012, 06:13 PM
Sure thing Professor:



We (the forth team) use only standard cheap off the shelf equipment, so we shouldn't have weird characters on the key board.
The docs were written with text copied from the screen, so now we have to figure out where they got switched.
I think something is the tool chain is giving "extra help" in efforts to meet or exceed customer expectations. Which always is annoying.

IF I could impose on you, could you please tell me so I can open a ticket:
1) OS and PC you are using
2) application used to open PropForth.HTML
3) the characters you found that are mis-translated (if there are more after " and -)
4) the terminal program you use to talk to the prop

If I can reproduce the error, I might be able to figure out who is the culprit and take appropriate action. Otherwise I will put in a note about not being able to copy the examples, which would not be the best.

1. Windows Vista, Toshiba Satellite Laptop,
2. SeaMonkey, a Mozilla/Netscape product.
3. So far just the quote and minus.
4. TerraTerm 4.72, with the "Select only by Left Button paste mode.

My editor is Edit+ v3.11. The Edit+ internal browser showed the same thing.
I simply used the search and replace function to fix the document.

I can't repeat it now that I replaced the offending characters.

Hmmm I could download the document again. Here is a clip from the original document:
sc c” Hello world” cr st? cr .cstr cr st? with bad quote
sc : test3 begin st? 1 – dup 0 = st? until ; 3 test3 with bad dash
And my edited clips:
sc c" Hello world" cr st? cr .cstr cr st? with good quote
sc : test3 begin st? 1 - dup 0 = st? until ; 3 test3 with good minus

Duane J

mindrobots
04-01-2012, 02:40 AM
Not what I wanted/expected to find.

If I cut/paste sample code from the actual word document (PropForth.docx), the examples work. The quotes are real generic quotes as expected.

If I cut/paste from the .html (in Firefox 12.0 in my case), the quotes are opening and closing quotes and don't work with the Forth code.

Both cases are being pasted into Tera Term 3.1.3 and the EEPROM kernel.

The HTML doc has the same font as Word (Lucida Console) - the quote characters in the HTML source appear to be opening and closing quotes in the HTML document source.

The double quote in the Word doc can be created by using the double quote on the keyboard. In the HTML doc, the double quote used in HTML tags appears to be the standard double quote as typed on the keyboard in whatever font you are currently using. The quote around the Hello world is a differently displayed double quote in the HTML doc.

I assume the .HTML was created from Word and not some other tool.

More investigation to come as the basketball game continues - Go Bucks!!

mindrobots
04-01-2012, 04:32 AM
It's all about SmartQuotes! Word turns those on by default for you as an auto-correction option. :thumb:

I haven't checked if LibreOffice has the same issues.

Turn turn them off and fix with Word 2003 and 2007: http://news.cnet.com/8301-13880_3-9835631-68.html

For Word 2010: Click on the "File" tab, click on "Options", click on "Proofing", click on "Auto Correct Options", click on "Auto Format as You Type" tab. On that tab is a checkbox for "Replace Straight Quote with Smart Quotes" - make sure that box is NOT checked.

If you have an existing document at this point that you want to fix, you can use "Replace" and just type a double quote in both the "Find" and "Replace" box and say "Replace All".

I did that with the PropForth.docx file and then saved it as an HTML to create the attached (zipped) file. The examples I've tried cutting and pasting from the attached have worked.

You learn something new everyday!!

prof_braino
04-01-2012, 05:11 PM
Updated issue 145 with our notes from today.

Now I see that Rick has done some investigation, and may have solved the whole issue.

Thanks! I'll add this to the issue and forward it to Sal, I think you've saved us a bunch of time!