|
In lugnet.cad, Allan Bedford wrote:
|
In lugnet.cad, Kevin L. Clague wrote:
|
In lugnet.cad, Allan Bedford wrote:
|
In lugnet.cad, Kevin L. Clague wrote:
|
Ill work on the blanks in filename problem in LPub.
|
That will be so nice. Thank you! That one caught me again just this
afternoon. And I know better. However, I just forgot at one point, added a
space to a file name and.... well you know the rest. :)
Anyway, glad to hear its fixable.
Best regards,
Allan B.
The LEGO Builders Guide
|
Hi Allan,
In light of this article:
http://news.lugnet.com/cad/?n=12556
I now have a dilema on this topic. Add code that makes me compatible with
MLCad but violating the specification, or leave it as is and explain to
people that MLCad does allow blanks in file names, but that violates the
spec.
|
I apologize in advance if this is a stupid solution but what about this:
Is there a way for you to check for spaces in the file name as lpub attempts
to open it? If so, can you then abort the file open process and throw a
pop-up message that says something like:
You are attempting to open a file that contains spaces in the name. Please
rename the file, without spaces, and try opening the file again.
At the moment the biggest problem (as I see it) is the lack of error handling
when lpub tries to handle a file with spaces. It returns all kinds of
messages but is the real error listed there? If so, I didnt see it last
time it happened. It was only after manually looking at my filename that I
realized what had happened. If lpub could simply be a bit more pro-active, I
feel that would be the easiest solution to code and also keep you in line
with the spec.
|
You are right, but the error handling problem is larget than just blanks in file
names. All of this boils down to the wimpy method that LPub uses to parse LDraw
files. If you type in a meta-command 0 LPUB PIL, rather than 0 LPUB PLI,
lpub just hapilly ignores it.
If you have an add part line:
1 7 x y z a b c d e f g h i file name with blanks
LPub picks up this part and calls it good:
1 7 x y z a b c d e f g h i file
and ignores the rest. This leads me to my feeling that LPub is user hostile.
I want to improve the parsing to make it give you warnings and such, so you have
a clue. LPub should at least check the syntax of the meta-commands it supports,
including MLCad.
It will give much quicker feedback to users than them sending and waiting for
email.
Expecially with LPubs plethora of new meta-commands related to placement,
syntax checking and feedback has become much more important. Im finding it
annoying, so that raises the priority ;^)
Im off to study lex and maybe yacc.
Thanks for the feedback. It is very welcome.
Kevin
|
I hope that helps. Again, this is just my own opinion on the matter.
Best regards,
Allan B.
|
|
|
|
"Kevin L. Clague" <kevin_clague@yahoo.com> wrote in message
[ ... snipped ... ]
>
> I'm off to study lex and maybe yacc.
[ ... snipped ... ]
I highly recommend the O'Reilly "lex and yacc" book, I found it very helpful
for a project I did at work a number of years ago. The moderated
"comp.compilers" newsgroup is also an excellent resource for lex and yacc
questions. IMHO, if you use lex, you ought to use yacc as well, they really
go hand in hand.
Mike
--
Mike Walsh - mike_walsh at mindspring.com
http://www.ncltc.cc - North Carolina LEGO Train Club
http://www.carolinatrainbuilders.com - Carolina Train Builders
http://www.bricklink.com/store.asp?p=mpw - CTB/Brick Depot
|
|
|