Skip to main content
December 27, 2007
Question

Translation From VB

  • December 27, 2007
  • 3 replies
  • 1301 views
Could anyone help me with this translation to CFML please?
This topic has been closed for replies.

3 replies

Inspiring
December 27, 2007
Forget the vb code. It's easier to do it from scratch. What do you mean by:
"Basically what we want is right now we have 20 parts that come down and they each have a description,
We want to group them by the description and only show the description after the last PartNo "
?

Specifically, what do you mean by,
"only show the description after the last PartNo"?
December 28, 2007
ok For a 2005 Honda Civic this is the Result I get:

FHO-556 Front Disc Brake Rotor 2 F1 Sport Brake Rotors
Use with: SubModel: Hybrid
FHO-556 Front Disc Brake Rotor 2 F1 Sport Brake Rotors
Use with: 1.7L L4
HO-556 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: SubModel: Hybrid
HO-556 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: 1.7L L4
HO-584 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: 2.0L L4
HOD-56 Rear Brake Drum 2 AutoStar Drum & Rotor
Use with: 1.7L L4


I would like it to be like this

FHO-556 Front Disc Brake Rotor 2 F1 Sport Brake Rotors
HO-556 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
HOD-56 Rear Brake Drum 2 AutoStar Drum & Rotor
Use with: 1.7L L4

HO-584 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: 2.0L L4

FHO-556 Front Disc Brake Rotor 2 F1 Sport Brake Rotors
HO-556 Front Disc Brake Rotor 2 AutoStar Drum & Rotor
Use with: SubModel: Hybrid
Inspiring
December 28, 2007
Take a look at the group attribute of the cfoutput tag. The CF8 documentation includes a sample to demonstrate the use of the group attribute. www.easycfm.com also has a tutorial on this topic.

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_m-o_16.html#1101659
http://tutorial150.easycfm.com/
Inspiring
December 27, 2007
mactech999,

My VB is a bit rusty but it appears that your code sample is truncated. The outer do until loop does not appear to be closed.

Questions:
1. is rst an ADO recordset?
2. is this code part of a procedure or function?
3. Is NoRecs a procedure or function that is being called?
4. It appears that the purpose of the loop is to make the value of Numrecs that number of distinct PartNo values in the recordset. Is this correct?

Explaining what this code is trying to do might clarify things.
December 27, 2007
Sorry about that here is the code

This Code is part of a Event Procedure.
on AfterUpdate
Also In my Coldfusion Code Rst is know as Recordset1

NumRecs is Declared as a Variant

Basically what we want is right now we have 20 parts that come down and they each have a description,
We want to group them by the description and only show the description after the last PartNo
Inspiring
December 27, 2007
I understand the code but it looks incomplete. Is the intent to look for duplicate part numbers?