Normal Topic need programming example (Read 859 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
need programming example
May 28th, 2004 at 2:45pm
Print Post Print Post  
Any thoughts on how to convert the following 2 text fields to a more proper display of feet and inches?

2 Example text fields below:

4.06 x 4.11 Round
2.06 x 14 Runner

Should read

4' 6" x 4' 11" Round
2'6" x 14' Runner

I'm sure i need to be using @instr and @left, etc but I cant seem to put the programming together to make it work?

Any thoughts?

Thanks!

Steve in Texas
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: need programming example
Reply #1 - May 28th, 2004 at 3:02pm
Print Post Print Post  
How did 4 foot and 6 inches get in the format 4.06 in the first place?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: need programming example
Reply #2 - May 28th, 2004 at 3:13pm
Print Post Print Post  
I think it stemmed from lack of knowedge when setting up Q&A 15(?) years ago. We've been using it this way ever since.  Cry

  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: need programming example
Reply #3 - May 28th, 2004 at 3:34pm
Print Post Print Post  
Here is a first pass, untested approach that may be enough to get you started:

Quote:
//Replace periods:
//Start with 4.06 x 4.11 Round
value=@Replace(value,".","'")
//Result= 4'06 x 4'11 Round

//Remove leading 0 for inches
value=@Replace(value,"'0","'")
//Result= 4'6 x 4'11 Round

//Insert second inch marker
value=@Repllas(value," ",""")
//Result= 4'6 x 4'11" Round

//Insert first inch marker
value=@Replfir(value," ","" ")
//Result= 4'6" x 4'11" Round


May need some fine tuning for missing feet/inches.
Only need the lines that start with "value", other lines are here for explanation.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: need programming example
Reply #4 - May 28th, 2004 at 3:42pm
Print Post Print Post  
Wow, very clever Bob! Thanks.

Looks perfect for me.

If you don't mind, I'll test it out and then post it to the programming examples board.

Thanks again!

Steve in Texas
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: need programming example
Reply #5 - May 28th, 2004 at 3:47pm
Print Post Print Post  
Steve, make sure you have the latest, shorter version, edited at 12:42pm.  It looks like I may have made an editing change while you posted.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: need programming example
Reply #6 - May 28th, 2004 at 3:51pm
Print Post Print Post  
Yes, your right!!! Shocked I was looking at your first post. I'll work from your edited post. It looks great, too!

Thanks,

Steve in Texas
  
Back to top
IP Logged