|
-
Nov 23rd, 1999, 09:08 PM
#1
Thread Starter
Junior Member
I am writing to a file and I have come across
a problem. I have a text box of which the user can enter 1.2 or .4599 or .098 or 23.67 and when it writes to the file I need it to write as 12 or 4599 or 098 or 2367. Any way I can do this? (multilplication will not work because the decimal can be in any given place).
-
Nov 23rd, 1999, 09:23 PM
#2
Member
Use the Replace string manipulation function in VB. Start a Std Exe project, add 2 text boxes (txtEntered, txtReplaced) and a command button (cmdGo). Here's a one-liner to demonstrate. Add this code to your form:
Option Explicit
Private Sub cmdGo_Click()
txtReplaced = Replace(txtEntered, ".", "")
End Sub
[This message has been edited by mcleran (edited 11-24-1999).]
[This message has been edited by mcleran (edited 11-24-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|