dbTalk Databases Forums  

Importing formatted text

comp.databases.filemaker comp.databases.filemaker


Discuss Importing formatted text in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
James Hardy
 
Posts: n/a

Default Importing formatted text - 07-04-2004 , 09:30 PM






I'd like to import some chemical formula that use superscript and/or
subscript. I already have a field where I use html to specify <sub> and
<sup> formatting. Is there some sort of trick required so that I can get
the formatting to actually show up without doing it individually for over
23K records.

Thanks.

__________________________________________________ ______
Jim Hardy
Professor of Chemistry
The University of Akron
http://ull.chemistry.uakron.edu/



Reply With Quote
  #2  
Old   
The Shadow
 
Posts: n/a

Default Re: Importing formatted text - 07-05-2004 , 08:46 AM






If you are using FM7, there are now functions to control style in text.
*TextStyleAdd* would do the trick here.

A calculation like:
Let ( startSub = Position( txt; "<sub>"; 1; 1 );
__If ( startSub = 0; txt;
____Let ( endSub = Position( txt; "</sub>"; startSub+5; 1 );
_______Left( txt; startSub-1 )
_______& TextStyleAdd( Middle( txt; startSub+5; endSub - startSub -
); Subscript )
_______& Right( txt; Length(txt) - endSub - 5 )
____)
__)
)

will replace a single <sub>...</sub> pair with a subscripted piece o
text. You could apply this repeatedly in a script, or if you have Dev
make a custom function that loops over all of them.

If you're using FM6, I don't think its possible without obtaining
plug-in to manipulate style information
-
The Shado
-----------------------------------------------------------------------
Posted via http://www.webservertalk.co
-----------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message294786.htm


Reply With Quote
  #3  
Old   
JimHardy
 
Posts: n/a

Default Re: Importing formatted text - 07-11-2004 , 09:37 PM



The Shadow wrote:
Quote:
*If you are using FM7, there are now functions to control style i
text. [b]TextStyleAdd* would do the trick here.

A calculation like:
Let ( startSub = Position( txt; "<sub>"; 1; 1 );
__If ( startSub = 0; txt;
____Let ( endSub = Position( txt; "</sub>"; startSub+5; 1 );
_______Left( txt; startSub-1 )
_______& TextStyleAdd( Middle( txt; startSub+5; endSub - startSub -
); Subscript )
_______& Right( txt; Length(txt) - endSub - 5 )
____)
__)
)

will replace a single <sub>...</sub> pair with a subscripted piece o
text. You could apply this repeatedly in a script, or if you hav
Dev7 make a custom function that loops over all of them.

If you're using FM6, I don't think its possible without obtaining
plug-in to manipulate style information. [/B
-
JimHard
-----------------------------------------------------------------------
Posted via http://www.webservertalk.co
-----------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message294786.htm



Reply With Quote
  #4  
Old   
JimHardy
 
Posts: n/a

Default Re: Importing formatted text - 07-11-2004 , 09:37 PM



Thanks. That worked just as you explained. If I create subsequen
fields, I can format an additional subscript each time.

I have access to a copy of Filemaker Pro 7 DEV and would appreciated i
if you could explain the next step - looping through all of th
<sub></sub> in a single calculation.

I guess I must suffer from some sort of block when it comes to thi
problem and greatly appreciate your advice
-
JimHard
-----------------------------------------------------------------------
Posted via http://www.webservertalk.co
-----------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message294786.htm


Reply With Quote
  #5  
Old   
The Shadow
 
Posts: n/a

Default Re: Importing formatted text - 07-12-2004 , 03:37 AM



Replied at:

http://www.fmforums.com/threads/showflat.php?114191

It took me a bit of pondering to remember why I had a file that di
this... I thought it sounded familar
-
The Shado
-----------------------------------------------------------------------
Posted via http://www.webservertalk.co
-----------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message294786.htm


Reply With Quote
  #6  
Old   
JimHardy
 
Posts: n/a

Default Re: Importing formatted text - 07-12-2004 , 08:38 AM



Thanks again. We do seem to be having the same discussion on tw
different boards.

I'll take a good look at your example right after I teach my class
-
JimHard
-----------------------------------------------------------------------
Posted via http://www.webservertalk.co
-----------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message294786.htm


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.