forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Non-numeric characters output by %wf

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Wed Nov 24, 2010 1:01 pm    Post subject: Non-numeric characters output by %wf Reply with quote

Specifically, the following line:

Code:
          iodial = winio@ ('%ff%nl%cn%6.2wf&', paltot)


whose only purpose is to confirm that a set of numbers that ought to add up to 100 actually do so, is currenly producing one of two possible outputs to the screen: usually 100.00, and occasionally 100.0x, where x appears to be char(148). At any rate, it is non-numeric; it is a lower case o with something over the top that my eyes are unable to resolve without fiddling around with text size.

Can anyone suggest why this might be happening (needless to say, I imagine the chances of reproducing this in a small test app are negligible)? %wf is pretty fundamental so I don't seriously believe there is a bug associated with it. The only thing I can think of is some sort of memory corruption caused by my own code, but if so it's unwittingly very targeted Very Happy
Back to top
View user's profile Send private message Send e-mail
IanLambley



Joined: 17 Dec 2006
Posts: 514
Location: Sunderland

PostPosted: Wed Nov 24, 2010 1:13 pm    Post subject: Reply with quote

Try using:
Code:

      character*6 paltot_c

      write(paltot_c,100)paltot
  100 format(f6.2)

      iodial = winio@ ('%ff%nl%cn%6ws&', paltot_c)


Regards
Ian
Back to top
View user's profile Send private message Send e-mail
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Wed Nov 24, 2010 1:18 pm    Post subject: Reply with quote

Um, OK ... you have a good reason for thinking my line of code is dodgy?
Back to top
View user's profile Send private message Send e-mail
IanLambley



Joined: 17 Dec 2006
Posts: 514
Location: Sunderland

PostPosted: Wed Nov 24, 2010 2:09 pm    Post subject: Reply with quote

Actually, I think it might be %wf that is dodgy, or maybe something to do with Windows. Try it on another machine.

You could also try a %`rf - you loose the nice formatting but you can update the value without rewriting the whole window. I usually use %`rs and write to the character variable as in my other suggestion.

Ian
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8283
Location: Salford, UK

PostPosted: Thu Nov 25, 2010 9:57 am    Post subject: Reply with quote

%wf will use the C function sprintf with %f and I guess that this function is not always able to squeeze the given number into the desired format.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group