[comp.sys.atari.st] TEDINFO info requested

dmb@TIS.COM (David M. Baggett) (04/08/88)

   I've been writing a GEM program with TEDINFO (loaded in with rsrc_load)
and I've got a few questions:
	1) When I put up the TEDINFO, I type and nothing is accpeted.  I used
	   both the Digital Research RCS and the Laser RCP to make the resource
	   and I haven't gotten the TEDINFO that either one produces to work.
	   I have the template set to "XXXXXXXXXXXXXXXXX", so it should
	   take all characters, right?  Nope, the cursor just sits there...
	2) I missed all the talk about _ making TEDINFO's crash.  How do you
	   avoid this bug?  Users of this program may often want underscores
	   in the string I'm getting with the TEDINFO, so I don't want it
	   to blow up when they type one.

   If anyone has a short bit of code that puts up a TED and form_do'es it,
could you put it in a mail message here (or to me)?   Thanks in advance.

		Dave Baggett
		arpa: dmb@tis.com

jsp@sp7040.UUCP (John Peters) (04/10/88)

In article <8804072002.AA09315@grumpy.tis.com>, dmb@TIS.COM (David M. Baggett) writes:
> 	1) When I put up the TEDINFO, I type and nothing is accpeted.  I used
> 	   both the Digital Research RCS and the Laser RCP to make the resource
> 	   and I haven't gotten the TEDINFO that either one produces to work.
> 	   I have the template set to "XXXXXXXXXXXXXXXXX", so it should
> 	   take all characters, right?  Nope, the cursor just sits there...

Have you set the PVALID string?  The validation characters are as follows:
	Char	Input Allowed
	 9	Numeric
	 a	Both case alpha, plus space
	 n	Digits + a
	 p	All valid DOS path name characters
	 A	Uppercase alpha, maps lower to upper
	 N	Uppercase version of n
	 F	Valid DOS filename characters, plus wildcards * and ?
	 P	Valie DOS pathname characters, plus wildcards * and ?
	 X	Anything.

The template field is what will initially be in the field.  The valid field
validates what can be entered into the field.  If the valid field is empty, 
nothing can be entered.  See pp. 75-78 in the Sybex book.

dmb@TIS.COM (David M. Baggett) (04/19/88)

   A while back I asked two questions:
	1)  Why won't my TEDINFO accept any characters?
	2)  What is this '_' crash problem?

   Since then, I've gotten answers.  There seems to be some confusion about
these things, so to clear things up, I'll post what I know now:

Answers!

	1) My TEDINFO had the PVALID string set to "XXXXXXXXXX".  This means
	   "accept everything".  Unfortunately, I neglected to set the
	   field in the TEDINFO structure which specifies the length of the
	   input string (I think it's called tr_plength).  I thought at first
	   that this field was set by AES on return from form_do.  Sort of,
	   but that's not all.  Actually, you have to set tr_plength to the
	   MAXIMUM number of character the user is allowed to type.  It
	   was defaulting to zero, so the TEDINFO accepted no characters.

	2) The underscore bug afflicts a "middle" version of TOS -- the 
	   ROM version that isn't in the Mega's.  It causes the ST to
	   crash with nine or ten bombs when you type an underscore in
	   an editable text field (TEDINFO).  It does not only affect the
	   file selector box; it affects all TEDINFO's with 9's or 
	   P's in the PVALID string.  It may affect TEDINFO's with other
	   PVALID specifiers, too -- I haven't tried all of them.  I do
	   know, however, that there is NO PROBLEM with PVALID strings
	   with X's (X's mean "anything goes").  I have tested this; I've
	   got a text field that prompts for a variable name and underscores
	   cause no problem.  The solution, it would seem, is to make all
	   you TEDINFO's "XXXXXX" and then check the string for syntax
	   yourself.  This is kind of hack-ish, but it's guaranteed to wrok
	   on all the ST's (not just the Mega's).  You Mega people should 
	   test your software on 520's and 1040's before putting out if 
	   TEDINFO's are invovled!

Sorry to be so long-winded.  I hope this answers everyone's questions.  Thanks
to all who helped!
				Dave
				arpa: dmb@tis.com