CR .( loading Test20Hz)
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
On Saturday, May 28, 2022 at 9:54:32 AM UTC+2, gnuarm.del...@gmail.com wrote:
CR .( loading Test20Hz)The source code looks fine. No missing spaces or hidden special characters. Check the following:
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
a) Does GetAmpMeas work properly when you execute the command
directly? That is, does "20 GetAmpMeas" work as expected? Check
the stack after executing the command.
b) Is it possible that GetAmpMeas is an immediate word?
A faulty immediate word could explain the observed behavior.
On Saturday, May 28, 2022 at 5:49:01 AM UTC-4, Heinrich Hohl wrote:but I don't normally use immediate words and don't recall any in this code. Here's the definition.
On Saturday, May 28, 2022 at 9:54:32 AM UTC+2, gnuarm.del...@gmail.com wrote:
CR .( loading Test20Hz)The source code looks fine. No missing spaces or hidden special characters.
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Check the following:
a) Does GetAmpMeas work properly when you execute the command
directly? That is, does "20 GetAmpMeas" work as expected? Check
the stack after executing the command.
b) Is it possible that GetAmpMeas is an immediate word?GetAmpMeas is not immediate. The file I started with before typing a very few mods (mostly documentation updates) has worked fine since this program was last modified in 2016. I know the fact that bugs are not observed, does not mean there are none,
A faulty immediate word could explain the observed behavior.
: GetAmpMeas ( u1 -- u2 ) ( F: -- f ) \ Set frequency and measure AmpMeas as float
SetFreqRegs IF AmpMeasure dup 0 D>F ELSE -2 0E0 THEN
;
None of this code is being run when loading the file other than being compiled.
To debug a bit I added a line and eventually realized the problem is the association of .( ) and \. This is the original code. Removing the \ line makes it all work.
CR .( loading Test20Hz )
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Moving the \ line around allows different parts to work
CR .( loading Test20Hz )
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
\ On test failure, set output frequency
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
results in...
loading Test20Hz
Done loading Test20Hz
Done loading Test1kHz ok
So, somehow the .( printing and the \ comment words are interacting!
WTF???
With the last example where the \ comment is just before the Test20kHz definition, it seems to terminate interpretation.
loading Test20Hz
Done loading Test20Hz
Done loading Test1kHz ok
see test1khz
: TEST1KHZ lit 0x3E8 GETAMPMEAS . ; ok
see test20khz
^^^^^^^^^
Error(-13): TEST20KHZ is undefined
How could .( and \ be interacting like this?
Here is the startup from Win32Forth
Win32Forth: a 32 Bit Forth for Windows 95/98/ME/NT4/W2K/XP/VISTA/W7/W8/W10 Version: 6.15.05 Build: 2
Compiled: Thursday, December 24 2020, 5:12PM
Platform: Windows 10 Home, 8,747k bytes free
2,812 Words in Application dictionary
2,631 Words in System dictionary
5,443 Words total in dictionaries
20,312 Windows Constants available
Loading Win32For.CFG
Loading Win32ForUser.CFG
Current directory is: C:\Forth\Win32F61505\Win32Forth
Program path is: C:\Forth\Win32F61505\Win32Forth\Win32for.exe
Forth path is: C:\Forth\Win32F61505\Win32Forth\
Application path is: not set
Maybe I'll try posting to the Win32Forth groups.io group.
--
Rick C.
+ Get 1,000 miles of free Supercharging
+ Tesla referral code - https://ts.la/richard11209
On Saturday, 28 May 2022 at 20:33:25 UTC+2, gnuarm.del...@gmail.com wrote:but I don't normally use immediate words and don't recall any in this code. Here's the definition.
On Saturday, May 28, 2022 at 5:49:01 AM UTC-4, Heinrich Hohl wrote:
On Saturday, May 28, 2022 at 9:54:32 AM UTC+2, gnuarm.del...@gmail.com wrote:
CR .( loading Test20Hz)The source code looks fine. No missing spaces or hidden special characters.
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Check the following:
a) Does GetAmpMeas work properly when you execute the command
directly? That is, does "20 GetAmpMeas" work as expected? Check
the stack after executing the command.
b) Is it possible that GetAmpMeas is an immediate word?GetAmpMeas is not immediate. The file I started with before typing a very few mods (mostly documentation updates) has worked fine since this program was last modified in 2016. I know the fact that bugs are not observed, does not mean there are none,
A faulty immediate word could explain the observed behavior.
: GetAmpMeas ( u1 -- u2 ) ( F: -- f ) \ Set frequency and measure AmpMeas as float
SetFreqRegs IF AmpMeasure dup 0 D>F ELSE -2 0E0 THEN
;
None of this code is being run when loading the file other than being compiled.
To debug a bit I added a line and eventually realized the problem is the association of .( ) and \. This is the original code. Removing the \ line makes it all work.
CR .( loading Test20Hz )
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Moving the \ line around allows different parts to work
CR .( loading Test20Hz )
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
\ On test failure, set output frequency
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
results in...
loading Test20Hz
Done loading Test20Hz
Done loading Test1kHz ok
So, somehow the .( printing and the \ comment words are interacting!
WTF???Could it be that your file has UNIX line endings and Win32Forth are expecting Windows.
It looks like \ makes the rest of the file a comment
On Saturday, May 28, 2022 at 4:18:28 PM UTC-4, P Falth wrote:but I don't normally use immediate words and don't recall any in this code. Here's the definition.
On Saturday, 28 May 2022 at 20:33:25 UTC+2, gnuarm.del...@gmail.com wrote:
On Saturday, May 28, 2022 at 5:49:01 AM UTC-4, Heinrich Hohl wrote:
On Saturday, May 28, 2022 at 9:54:32 AM UTC+2, gnuarm.del...@gmail.com wrote:
CR .( loading Test20Hz)The source code looks fine. No missing spaces or hidden special characters.
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Check the following:
a) Does GetAmpMeas work properly when you execute the command directly? That is, does "20 GetAmpMeas" work as expected? Check
the stack after executing the command.
b) Is it possible that GetAmpMeas is an immediate word?GetAmpMeas is not immediate. The file I started with before typing a very few mods (mostly documentation updates) has worked fine since this program was last modified in 2016. I know the fact that bugs are not observed, does not mean there are none,
A faulty immediate word could explain the observed behavior.
deleting a line that is commented out causes the symptom from the code above to change.: GetAmpMeas ( u1 -- u2 ) ( F: -- f ) \ Set frequency and measure AmpMeas as float
SetFreqRegs IF AmpMeasure dup 0 D>F ELSE -2 0E0 THEN
;
None of this code is being run when loading the file other than being compiled.
To debug a bit I added a line and eventually realized the problem is the association of .( ) and \. This is the original code. Removing the \ line makes it all work.
CR .( loading Test20Hz )
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Moving the \ line around allows different parts to work
CR .( loading Test20Hz )
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
\ On test failure, set output frequency
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
results in...
loading Test20Hz
Done loading Test20Hz
Done loading Test1kHz ok
So, somehow the .( printing and the \ comment words are interacting!
WTF???Could it be that your file has UNIX line endings and Win32Forth are expecting Windows.
It looks like \ makes the rest of the file a commentI tried deleting and retyping lines, especially the comment line. This has all been done under Windows by typing into an editor I've used for 20+ years, so hard to see how that could happen. Also, the last test showed a very strange result where
Rick C.
-+ Get 1,000 miles of free Supercharging
-+ Tesla referral code - https://ts.la/richard11209
On Saturday, 28 May 2022 at 22:29:48 UTC+2, gnuarm.del...@gmail.com wrote:none, but I don't normally use immediate words and don't recall any in this code. Here's the definition.
On Saturday, May 28, 2022 at 4:18:28 PM UTC-4, P Falth wrote:
On Saturday, 28 May 2022 at 20:33:25 UTC+2, gnuarm.del...@gmail.com wrote:
On Saturday, May 28, 2022 at 5:49:01 AM UTC-4, Heinrich Hohl wrote:
On Saturday, May 28, 2022 at 9:54:32 AM UTC+2, gnuarm.del...@gmail.com wrote:
CR .( loading Test20Hz)The source code looks fine. No missing spaces or hidden special characters.
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Check the following:
a) Does GetAmpMeas work properly when you execute the command directly? That is, does "20 GetAmpMeas" work as expected? Check
the stack after executing the command.
b) Is it possible that GetAmpMeas is an immediate word?GetAmpMeas is not immediate. The file I started with before typing a very few mods (mostly documentation updates) has worked fine since this program was last modified in 2016. I know the fact that bugs are not observed, does not mean there are
A faulty immediate word could explain the observed behavior.
deleting a line that is commented out causes the symptom from the code above to change.: GetAmpMeas ( u1 -- u2 ) ( F: -- f ) \ Set frequency and measure AmpMeas as float
SetFreqRegs IF AmpMeasure dup 0 D>F ELSE -2 0E0 THEN
;
None of this code is being run when loading the file other than being compiled.
To debug a bit I added a line and eventually realized the problem is the association of .( ) and \. This is the original code. Removing the \ line makes it all work.
CR .( loading Test20Hz )
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Moving the \ line around allows different parts to work
CR .( loading Test20Hz )
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
\ On test failure, set output frequency
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
results in...
loading Test20Hz
Done loading Test20Hz
Done loading Test1kHz ok
So, somehow the .( printing and the \ comment words are interacting!
WTF???Could it be that your file has UNIX line endings and Win32Forth are expecting Windows.
It looks like \ makes the rest of the file a commentI tried deleting and retyping lines, especially the comment line. This has all been done under Windows by typing into an editor I've used for 20+ years, so hard to see how that could happen. Also, the last test showed a very strange result where
Check the file in a hex editor to find out what ends the comment line.
It really look like it lets the comment run to the end of the file.
What happens if you put your comments inside ( ) instead?
This is one of those things that cause problems with virtually no advantage= >. The two camps are never going to change, so we have to live with the muc= >kups because of it.=20
On Saturday, May 28, 2022 at 4:18:28 PM UTC-4, P Falth wrote:but I don't normally use immediate words and don't recall any in this code. Here's the definition.
On Saturday, 28 May 2022 at 20:33:25 UTC+2, gnuarm.del...@gmail.com wrote:
On Saturday, May 28, 2022 at 5:49:01 AM UTC-4, Heinrich Hohl wrote:
On Saturday, May 28, 2022 at 9:54:32 AM UTC+2, gnuarm.del...@gmail.com wrote:
CR .( loading Test20Hz)The source code looks fine. No missing spaces or hidden special characters.
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Check the following:
a) Does GetAmpMeas work properly when you execute the command directly? That is, does "20 GetAmpMeas" work as expected? Check
the stack after executing the command.
b) Is it possible that GetAmpMeas is an immediate word?GetAmpMeas is not immediate. The file I started with before typing a very few mods (mostly documentation updates) has worked fine since this program was last modified in 2016. I know the fact that bugs are not observed, does not mean there are none,
A faulty immediate word could explain the observed behavior.
deleting a line that is commented out causes the symptom from the code above to change.: GetAmpMeas ( u1 -- u2 ) ( F: -- f ) \ Set frequency and measure AmpMeas as float
SetFreqRegs IF AmpMeasure dup 0 D>F ELSE -2 0E0 THEN
;
None of this code is being run when loading the file other than being compiled.
To debug a bit I added a line and eventually realized the problem is the association of .( ) and \. This is the original code. Removing the \ line makes it all work.
CR .( loading Test20Hz )
\ On test failure, set output frequency
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
Moving the \ line around allows different parts to work
CR .( loading Test20Hz )
: Test20Hz ( -- ) 20 GetAmpMeas . ;
CR .( Done loading Test20Hz)
: Test1kHz ( -- ) 1000 GetAmpMeas . ;
CR .( Done loading Test1kHz)
\ On test failure, set output frequency
: Test20kHz ( -- ) 20000 GetAmpMeas . ;
CR .( Done loading Test20kHz)
results in...
loading Test20Hz
Done loading Test20Hz
Done loading Test1kHz ok
So, somehow the .( printing and the \ comment words are interacting!
WTF???Could it be that your file has UNIX line endings and Win32Forth are expecting Windows.
It looks like \ makes the rest of the file a commentI tried deleting and retyping lines, especially the comment line. This has all been done under Windows by typing into an editor I've used for 20+ years, so hard to see how that could happen. Also, the last test showed a very strange result where
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 40:49:39 |
Calls: | 6,708 |
Calls today: | 1 |
Files: | 12,243 |
Messages: | 5,353,727 |