PDA

View Full Version : Question for GT on parser ???


stuball
04-13-2002, 12:38 PM
Hi GT
I am trying to fill an empty character field with a 0 and am unable to figure out the command.
I can fill empty character fields with a 0 but not character fields. Am I totally stupid or just
totally uneducated???? Appreciate your help in this matter..Have a nice day !!!!!!

Stuball:eek:

GameTheory
04-13-2002, 03:47 PM
There's a couple ways to do it depending on your preference.


I think you have some of this figured out already, but just for clarity:

A numeric field will appear as 0 if there is no value in it (or the value actually equals 0).

A character field will appear as nothing if there is no value, but since it is a character field, it will still have the quotes, like this: ""

You can use a substitution rule to match "nothing" like this:

[]=[0]

That will change nothing to a 0 in a character field, but still with the quotes: "0".

You can use the "blank" field designation (-) in your rules also:

[]=[-]

Now "nothing" equals blank -- no quotes, no anything.

So if you want all blank & empty fields to have zeros with no quotes around them, redefine blank to be a zero at the bottom of the template:

[blank]=[0]

along with

[]=[-]

in your character fields.


Example:

X:claim flag *c1 []=[-]

EOFF
[blank]=[0]


Now it will output:

"c" if the horse was claimed, or 0 (no quotes) if not.

To output "0" (with quotes) instead, use []=[0] without any redefinition of [blank].


I can't believe I said at the top this would bring clarity. That's gotta be the most confusing thing I've ever written....

stuball
04-14-2002, 09:31 AM
Thanks GT
I think I may actually have uderstood more than 1/2 of what you said that may be enough to
solve the problem. Thanks !!

Stuball

stuball
04-14-2002, 09:42 PM
Hi again

Could you help me with 1 more little problem?
For every occurence of (comma - space example, )
I would like to sustitute (semicolon - space) I can do it with replace command in wordpad but would like to have program do it for me....any suggestions.....Thanks Have a nice day !!!!

P.S. please send me your snail mail addy so I can send you a little something(can't afford much but
want to show appreciation for all your work and
help. My email addy is stuballzzz@yahoo.com till I have to move as Yahoo is starting to charge..
Thanks again...

Stuball

GameTheory
04-15-2002, 11:48 AM
Ummm...

I'm not exactly sure what you mean, but if you mean you need to get rid of the commas inside character fields, then the only way to currently do that is in multi-mode with the new [replace] command, but it is a bit tricky.

I was actually thinking of just replacing any commas inside character fields with semi-colons anyway to avoid confusion. So if you can wait a few days I'll do that in the next release...