Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Having some trouble with what seems to be a simple problem.
I have to write a 1-dimensional array of integer numbers to a text file. The output has to be in this format: 1247 8541 329125 14 Have tried all the possible combinations of write and print, but can't get the above result. I have no problem doing this with a 2-dimensional array. Thanks for any advice. RBS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
RBS
This worked Sub WriteInt() Dim MyArr As Variant Dim FName As String Dim Fnum As Long Dim i As Long FName = "c:\dick\ng\oct\integers.txt" Fnum = FreeFile MyArr = Array(1247, 8541, 329125, 14) Open FName For Output As Fnum For i = LBound(MyArr) To UBound(MyArr) Print #Fnum, MyArr(i) Next i Close Fnum End Sub -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "RB Smissaert" wrote in message ... Having some trouble with what seems to be a simple problem. I have to write a 1-dimensional array of integer numbers to a text file. The output has to be in this format: 1247 8541 329125 14 Have tried all the possible combinations of write and print, but can't get the above result. I have no problem doing this with a 2-dimensional array. Thanks for any advice. RBS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks.
My problem was that I hadn't realised that IsMissing for function arguments doesn't work when the argument is an integer. RBS "Dick Kusleika" wrote in message ... RBS This worked Sub WriteInt() Dim MyArr As Variant Dim FName As String Dim Fnum As Long Dim i As Long FName = "c:\dick\ng\oct\integers.txt" Fnum = FreeFile MyArr = Array(1247, 8541, 329125, 14) Open FName For Output As Fnum For i = LBound(MyArr) To UBound(MyArr) Print #Fnum, MyArr(i) Next i Close Fnum End Sub -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "RB Smissaert" wrote in message ... Having some trouble with what seems to be a simple problem. I have to write a 1-dimensional array of integer numbers to a text file. The output has to be in this format: 1247 8541 329125 14 Have tried all the possible combinations of write and print, but can't get the above result. I have no problem doing this with a 2-dimensional array. Thanks for any advice. RBS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Write to Array from other closed Excel file | Excel Programming | |||
add to two dimensional array | Excel Programming | |||
2 Dimensional Array | Excel Programming | |||
2 Dimensional Array | Excel Programming | |||
Sorting a 2-dimensional array | Excel Programming |