Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Submitting comma delimited data
Message
From
11/05/2011 13:04:42
 
 
To
11/05/2011 12:56:15
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01510319
Message ID:
01510354
Views:
51
>>>>>Alright, I just tried it and it's still only giving me the first file I type in, ignoring the comma and other file I type after it... This is what the code looks like now:
>>>>>
>>>>>
NumberRecords = GETWORDCOUNT(m.bnin)
>>>>>			FOR i = 1 TO NumberRecords
>>>>>				m.bn = PADL(GetWordNum(m.bnin, i, ","),7,"0")				
>>>>>   			
>>>>>			*Opens the DBF file in the "key" folder, appends "A" and adds the user input as batch number
>>>>>			OpenTable(goWCServer.oConfig.oTask.cBTSPath+[key\A]+m.bn,[AppExp])
>>>>>			
>>>>>			*Select columns from table above, name them for Excel headers
>>>>>			SELECT 	bn as [BatchNum],;
>>>>>					pk as [RecNo],;
>>>>>					"" as [Approved],;
>>>>>					shdt as [ShipDate],;
>>>>>					canm as [Carrier],;
>>>>>					prno as [Pro],;
>>>>>					blno as [BOL],;
>>>>>					shnm as [Shipper],;
>>>>>					ozp as [OZip],;
>>>>>					conm as [Consignee],;
>>>>>					dzp as [DZip],;
>>>>>					wtttl as [Weight],;
>>>>>					"" as [ReWeigh],;
>>>>>					"" as [Notes],;
>>>>>					accd1 as [Acc1],;
>>>>>					acamt1 as [Amt1],;
>>>>>					accd2 as [Acc2],;
>>>>>					acamt2 as [Amt2],;
>>>>>					accd3 as [Acc3],;
>>>>>					acamt3 as [Amt3];
>>>>>			FROM AppExp; 
>>>>>			ENDFOR
>>>>>			
>>>>>*Copy data from cursor to Excel file
>>>>>COPY TO ("C:\test\"+[bn]+m.bn+[T2.xls])
>>>>
>>>>you've got the endfor in the wrong place, it should be after the copy to
>>>
>>>
>>>I just tried that too and get the same result... I don't get it.
>>
>>
>>For debugging step through and see what NumberOfRecords is
>
>
>I didn't go through the debugger, but I did set NumberOfRecords to a messagebox and it shows as "1" after I hit export. It's just not seeing any other input.
>
>I don't know if this means anything, but I tried kind of combining your code with part of what Tore suggested:
>
>
NumberRecords = GETWORDCOUNT(m.bnin, ',')
>
>I added the ',' there and then it ignores the first number I type in and exports the second one after the comma. Basically it exported whatever the last record was, I tried three numbers at the same time and it only exported the third. I don't know if that's of any use for figuring this out but it's something different I noticed.

what does m.bnin look like?

If I do this in my command window I get 3 displayed:

?GETWORDcount("1,2,3",",")

which indicates 3 words have been found so that code should be OK
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform