programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

FIND problems

From: jma jma <jma_at_mfire.com>
Date: Fri, 29 Aug 2003 08:56:20 -0500

Hello, all:

I'm sure the problem here is my code, but I'm getting access violations m=
ixed
with div_by_0 errors when using FIND on a string I've created myself.

The problem is confusing to me for a few reasons: I can't seem to find we=
re /0
would even happen (in the FIND) routine. And when I replace FIND with oth=
er
words, everything works fine. I'm using PAD to hold the temporary string:=

: find-word ( -- )
    pad FIND nip if ( do something ) then ;

This is dying at find every time. However, if I change it to:

: find-word ( -- )
    pad [bug count type ." *" cr bug] ;

The console will display the word correctly (with the * right at the end =
of
it). I can use >NUMBER or any other word that makes use of a counted stri=
ng,
FIND is the only one that isn't working. But if I replace PAD with C" and=
 a
constant string, it works alright.

So my questions: what would cause FIND to produce a /0 error, and is ther=
e a
possible problem with using PAD? Anyone have any ideas? Thanks in advance=
=2E

Jeff

jma_at_mfire.com
http://www.simforth.com

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri Aug 29 2003 - 07:00:39 PDT

This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:09 PST