printtext.h

0 views
Skip to first unread message

RichardS

unread,
Nov 19, 2010, 11:56:28 AM11/19/10
to Exodus Users
Line 78 of printtext.h:

printfilename = printfilename ^ html ? ".HTM" : ".txt";

should be:

printfilename = printfilename ^ (html ? ".HTM" : ".txt");

As it stands, 'list' always creates a file named ".HTM"

Steve Bush

unread,
Nov 19, 2010, 12:09:39 PM11/19/10
to exodus...@googlegroups.com
indeed it should! I always burn my fingers on that darn x?a:b syntax and then go and use it again after some years thinking it is cool.

                if (html)
                    printfilename^=".HTM";
                else
                    printfilename^=".txt";

I fixed it in subversion already and will be in the next binary releases too.


--
You received this message because you are subscribed to the Google Groups "Exodus Users" group.
To post to this group, send email to exodus...@googlegroups.com.
To unsubscribe from this group, send email to exodus-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/exodus-users?hl=en.


RichardS

unread,
Nov 19, 2010, 12:13:47 PM11/19/10
to Exodus Users
And also, after line 223:

tx.osbwrite(printfile,printptr);

you need to add

printptr += tx.length();

to get the data written to the output file.


On Nov 19, 5:09 pm, Steve Bush <neosys....@gmail.com> wrote:
> indeed it should! I always burn my fingers on that darn x?a:b syntax and
> then go and use it again after some years thinking it is cool.
>
>                 if (html)
>                     printfilename^=".HTM";
>                 else
>                     printfilename^=".txt";
>
> I fixed it in subversion already and will be in the next binary releases
> too.
>
> On Fri, Nov 19, 2010 at 8:56 PM, RichardS <richardswingw...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Line 78 of printtext.h:
>
> > printfilename = printfilename ^ html ? ".HTM" : ".txt";
>
> > should be:
>
> > printfilename = printfilename ^ (html ? ".HTM" : ".txt");
>
> > As it stands, 'list' always creates a file named ".HTM"
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Exodus Users" group.
> > To post to this group, send email to exodus...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > exodus-users...@googlegroups.com<exodus-users%2Bunsubscribe@google groups.com>
> > .

Ashley Chapman

unread,
Nov 19, 2010, 12:17:05 PM11/19/10
to exodus...@googlegroups.com
On 19 November 2010 17:09, Steve Bush <neosys.com@gmail.com> wrote:
indeed it should! I always burn my fingers on that darn x?a:b syntax and then go and use it again after some years thinking it is cool.

                if (html)
                    printfilename^=".HTM";
                else
                    printfilename^=".txt";

What's the idea of the inconsistent case?  Windows will map it to uppercase, but Unix will leave it as is.  Would it not be better to choose the usual lowercase throughout?
 

I fixed it in subversion already and will be in the next binary releases too.


On Fri, Nov 19, 2010 at 8:56 PM, RichardS <richards...@gmail.com> wrote:
Line 78 of printtext.h:

printfilename = printfilename ^ html ? ".HTM" : ".txt";

should be:

printfilename = printfilename ^ (html ? ".HTM" : ".txt");

As it stands, 'list' always creates a file named ".HTM"

--
You received this message because you are subscribed to the Google Groups "Exodus Users" group.
To post to this group, send email to exodus...@googlegroups.com.
To unsubscribe from this group, send email to exodus-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/exodus-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Exodus Users" group.
To post to this group, send email to exodus...@googlegroups.com.
To unsubscribe from this group, send email to exodus-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/exodus-users?hl=en.



--
Ashley Chapman

Steve Bush

unread,
Nov 19, 2010, 12:42:56 PM11/19/10
to exodus...@googlegroups.com
printptr is automatically incremented inside osbwrite() in exodus implementation or will very shortly be so. I mean within days.

I do realise that this is NOT how it worked in the past and requires care to change your code not to double increment it after osbwrite() however it seems unavoidable for the following reason.

When outputting to UTF8 format the printptr moves by an unpredictable number of bytes which may NOT equal to the number of characters in the string you write.

Internally Exodus characters are 2 or 4 bytes depending if you are on Windows or elsewhere.

Strictly speaking when writing UTF8 files one should not be able to specify an offset at all because you could start writing in the middle of 2 or 3 bytes that together represent one character. With UTF8 one should only ever be really be allowed to append text however, at this point, I am reluctant to add a new "offset-less" or streaming version of osbwrite.

In general I have avoided any "improvements" to traditional multivalue but in this case I think it is possible and best to adapt to a new landscape.

To unsubscribe from this group, send email to exodus-users...@googlegroups.com.

Steve Bush

unread,
Nov 19, 2010, 4:21:14 PM11/19/10
to exodus...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages