Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fill dictionary with summ and 2 keys

Status
Not open for further replies.

2009luca

Programmer
Jul 27, 2013
222
IT
Sorry me for bad english.

i have this txt file and i read lineby line with the tipical freefile=file, ecc:

...
code subcode euro
Z45 A 67,90
Z45 B 1,89
Z47 B 10,00
...

I get the value of cod, subcode and euro with a mid function and assign to:

varcod
varsubcode
vareuro

i need with a Dictionary object (or other way) based nthe join of code&subcode summ of euro, example:

line of txt
varcod&subcode not exists, assign to the key of Dictionary, Z45A, 67,90
second line of txt
varcod&subcode not exists, assign to the key of Dictionary, Z45B, 1,89
3thline ne of txt
varcod&subcode just exists, sum 10 to alread combination of the key of Dictionary, Z45B, 1,89
....
ecc

final result to the end of loop txt:

Z45A, 67,90
Z45B, 11,89

i hope to be clear:)

note:
before to the end of code, post a simple code to loop the DictionARY, with a for next

 
If you are using dictionary, I would guess you do it in VB.NET (this forum here is for VB 5 & 6), so you'd be better off asking your question in Visual Basic(Microsoft) -VB.NET Forum

More information about VB.NET Dictionary here

"... with a mid function ..."

I would suggest Split instead.

Have fun.

---- Andy
 
hi friend tks....
but i use vb6 classic in my project[2thumbsup]
 
Could you show your code, and mark (highlight) where you have a problem and state what the problem is, please?

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top