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 

Incomplete display with %st format code

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



Joined: 18 Feb 2005
Posts: 56
Location: Gummersbach, Germany

PostPosted: Wed Mar 02, 2005 12:53 am    Post subject: Incomplete display with %st format code Reply with quote

When I had a problem, that a character string was not displayed properly with %st format code, I was able to write a short sample program to demonstrate the problem.

The program creates a sequence of 3 ClearWin forms to display slightly different character strings. However, the displayed strings in the first 2 cases are obviously incomplete. It seems that a certain sequence of characters is recognized as a terminating symbol.

The program is quite short. Therefore it can be listed below:

program test
implicit none
!
! Editor: Thomas Will
! Phone : +49/(0)211/4726-179
! e-mail: thomas.will@power.alstom.com
!
! ClearWin+ format code '%st' is not working properly
! in some cases
!
INCLUDE <windows.ins>
CHARACTER*80 string
INTEGER i
!
! incomplete output
string='Verzeichnis: P:TR_ANWENDUNGSTROEMUNGSBERECHNUNGPUMAUSBEISPIELE '
i=winio@('%67st',string(1:67))
!
! still incomplete (2 chars changed)
string='Verzeichnis: P:TR_ANWENDUNGSTROEMUNGSBERECHNUaaPUMAUSBEISPIELE '
i=winio@('%67st',string(1:67))
!
! complete (1 additional char changed)
string='Verzeichnis: P:TR_ANWENDUNGSTROEMUNGSBERECHNaaaPUMAUSBEISPIELE '
i=winio@('%67st',string(1:67))
!
stop
end

Thomas
_________________
Thomas
Back to top
View user's profile Send private message Visit poster's website
Martin



Joined: 09 Sep 2004
Posts: 43

PostPosted: Fri Mar 11, 2005 3:56 am    Post subject: Incomplete display with %st format code Reply with quote

The N in the %Nst format code specifies the width of the control in "average character" widths. The width of an average character may be less than the width of a large letter (e.g. a capital M). In your example the total pixel width of the first two strings is more than the last string. The first two strings are too long to fit inside 67 "average character widths" so they get word wrapped at the most appropiate place (i.e. at the last space).
Back to top
View user's profile Send private message
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