# Inconsistency between irb and Win7 cmd

**URL:** <https://www.ruby-forum.com/t/inconsistency-between-irb-and-win7-cmd/207305>\
**Category:** Ruby\
**Created:** [May 23, 2011, 2:07pm UTC](https://www.ruby-forum.com/t/inconsistency-between-irb-and-win7-cmd/207305 "2011-05-23T14:07:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [May 23, 2011, 2:07pm UTC](https://www.ruby-forum.com/t/inconsistency-between-irb-and-win7-cmd/207305/1 "2011-05-23T14:07:10Z")

</div>

I’m trying to print a string created from the contents of two arrays.

label = “”  
for i in 1…vArr.length-2  
label = “#{label}#{vArr[i]}#{dArr[i]}”  
end  
print label

vArr is an array of letters and dArr is an array of integers.  
The label should interweave the two.

When I run the code from irb the resulting string is: T0S6S50Q0  
When I run the code as part of a .rb file from the command prompt in  
Win7, I get: 8408368350810

In the latter, all letters have been converted to their integer  
representations.  
T=84  
S=83  
Q=81

I would like to run the .rb file from cmd and get the string I’m getting  
in irb.

Any help is welcomed. Thanks.

---

<div class="post-metadata">

**Author:** ![knappsych](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/74df32/32.png) [@knappsych](https://www.ruby-forum.com/u/knappsych)\
**Post date:** [May 23, 2011, 4:59pm UTC](https://www.ruby-forum.com/t/inconsistency-between-irb-and-win7-cmd/207305/2 "2011-05-23T16:59:05Z")

</div>

On May 23, 2011, at 5:09, William K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> vArr is an array of letters and dArr is an array of integers.  
> The label should interweave the two.
> 
> When I run the code from irb the resulting string is: T0S6S50Q0  
> When I run the code as part of a .rb file from the command prompt in  
> Win7, I get: 8408368350810

Sounds like a pathing issue and you’re running 1.8 via cmd and 1.9 for  
irb.

?a in 1.8 is the ASCII code for ‘a’.

?a in 1.9 is ‘a’.

Try %w[a b c]. It works the same in both.
