473,654 Members | 2,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting a line text into a column

I have created this little routine to export the values of some variables.
However there are two things I need to fix:
1. Instead of being on a line, I want them arranged one under another.
2. Those values come in brackets like " ". If I use the CLng() or CDbl()
they transform to zeros. Is there a way I can keep the numeric values and
get rid of the ""?
Thank you
J.C.

Open "C:\Temp\Tenseg rity.tmp" For Output As #1

Write #1, T_UOR, T_ULO, T_LOR, T_LLO, T_UOR2, T_ULO2, T_LOR2, T_LLO2,
T_Offset, T_LC, T_UBW, T_LBW, T_h, T_NoUnits1, T_NoUnits2, T_gs, T_RAX

Close #1

P.S. Please reply in the group because my new e-mail address is acting
funny.
Thanks again
Jul 17 '05 #1
1 1725
1. don't hard-code a file number ... there is no guarantee it will be
available. Use the FreeFile function...

dim hfile as long
hfile = FreeFile
open xxx for output as #hfile

2. use Print, rather than Write, to save without the quotes.

3. For multiple lines in the file, either insert a vbNewline between each
item in the single-line Print statement, or use multiple Prints ...

Print #hfile T_UOR & vbNewline & T_ULO & vbNewline & T_LOR & vbNewline &
T_LLO & vbNewline & ... etc

.... or...

Print #hfile T_UOR
Print #hfile T_ULO
Print #hfile T_LOR
Print #hfile T_LLO
... etc

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Jason Charalambides" <da************ @netscape.com> wrote in message
news:NE******** *********@twist er.austin.rr.co m...
: I have created this little routine to export the values of some variables.
: However there are two things I need to fix:
: 1. Instead of being on a line, I want them arranged one under another.
: 2. Those values come in brackets like " ". If I use the CLng() or CDbl()
: they transform to zeros. Is there a way I can keep the numeric values and
: get rid of the ""?
: Thank you
: J.C.
:
: Open "C:\Temp\Tenseg rity.tmp" For Output As #1
:
: Write #1, T_UOR, T_ULO, T_LOR, T_LLO, T_UOR2, T_ULO2, T_LOR2, T_LLO2,
: T_Offset, T_LC, T_UBW, T_LBW, T_h, T_NoUnits1, T_NoUnits2, T_gs, T_RAX
:
: Close #1
:
: P.S. Please reply in the group because my new e-mail address is acting
: funny.
: Thanks again
:
:
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2778
by: jamait | last post by:
Hi all, I m trying to read in a text file into a datatable... Not sure on how to split up the information though, regex or substrings...? sample: Col1 Col2 Col3 Col4 A0012430 REKAL TVÄTTMEDEL EKOMAX 0,5L ST 75.9000
4
3478
by: kscdavefl | last post by:
I ahve a datagrid on a web form. I need to change the value in column 3 as follows. If the value in column 3 reads 0, I want to change it to read YES. How can I accomplish this task. Thanks, Dave
4
5997
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over data from August or any prior month for that matter works fine which is why this is so weird. Note that June 2004 through today is stored in the same f_pageviews table. Nothing has changed on the server in the last couple of months. I upgraded...
13
10124
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the parent table. ----------------------------
24
2540
by: John Salerno | last post by:
This is a real small point, but I'd like to hear what others do in this case. It's more an 'administrative' type question than Python code question, but it still involves a bit of syntax. One thing I like to do is use tabs for my indentation, because this makes it easy to outdent when I need to start a new line in column 1. I can press backspace once and move 4 spaces to the left. But I read in the PEP that spaces are recommended over...
7
16349
by: PW | last post by:
Hi, I have a form with unbound fields on it. The user selects a record from a recordset and I populate the unbound fields. When I try to change the unbound quantity text box, Access 2003 tells me "The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record." This does not always happen. And yes, I can re-edit the quantity text
4
9450
by: TS | last post by:
I have a headerText for a header column that is "Page<br>Name". it puts a <brto force a line break, but the < and get encoded to &lt; and &gt; thus negating its effect as an html control and doesn't respect the line break I'm guessing this happens during render. What do i need to do to keep the line break?
11
2724
ironmonkey69
by: ironmonkey69 | last post by:
Right now, I have this python script that lets me choose which column of a text file that I can zero out. Them column nubmer is stored as the variable 'elem'. I also was given a sample of taking in command line arguements. I was wondering if anyone could help me intergrate this into the code so that from the command line I can input a number and have the script zero out the column. beginning text file: #Number of Bits 12 #Data 0 0 0...
5
1618
by: Lawrence Krubner | last post by:
I'm suppose to track FTP uploads to the server. I've got a cron script, written in PHP, that runs every 5 minutes and which does the command lsof | grep vsftpd This gives me a big file that has data like this in it: vsftpd 12316 lawrence cwd DIR 9,2 4096 20938763 /data/ftp/lawrence_krubner
9
2614
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of the main floors of the main house: Part C: Gross Floor Area of the basement or cellar: Part D: Gross Floor Area of the attic:
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8489
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8594
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.