# Source Code Line Numbers in VB6

**URL:** https://www.finalbuilder.com/forums/t/source-code-line-numbers-in-vb6/202
**Category:** Discussion
**Created:** [September 20, 2006, 8:14am UTC](https://www.finalbuilder.com/forums/t/source-code-line-numbers-in-vb6/202 "2006-09-20T08:14:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dpaultn](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/e9c0ed/32.png) [@dpaultn](https://www.finalbuilder.com/forums/u/dpaultn)
#### Post date: [September 20, 2006, 8:14am UTC](https://www.finalbuilder.com/forums/t/source-code-line-numbers-in-vb6/202/1 "2006-09-20T08:14:13Z")

</div>

All,  
  
Is is possible to add line numbers to VB6 source code within FinalBuilder?  
  
Thanks,  
Dave

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [September 21, 2006, 2:19am UTC](https://www.finalbuilder.com/forums/t/source-code-line-numbers-in-vb6/202/2 "2006-09-21T02:19:28Z")

</div>

Hi Dave,  
  
Yes, this should be possible. Off the top of my head, this is what I’d do:  
  
Create a Project variable to hold the line number “LineNo” set it to 1  
Create a Project variable to hold the contents of the new file "NewFileContents"  
Create a Project variable to hold the current line of the file "CurrentLine"  
Use a File Contents Iterator and set it to the file you want and set the variable to CurrentLine  
Add a Run Script Action as a child of the Iterator  
Put this code in the OnExecute:  
 NewFileContents = NewFileContents & vbCRLF & LineNo & " : " & CurrentLine  
 LineNo = LineNo + 1  
Then put a Create Text File action as a sibling (ie. same level) as the interator. Enter the filename and the contents will be %NewFileContents%  
  
hth!  
.t8
