• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing values between methods  RSS feed

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say i have the following code that tells me how long a string is, printing a vairabled called Sequence1Length.


How do i pass the value of Sequence1Length into another method in the same class? For example, lets just, for simplicity, that i just want to print it out. So far I have this....


Cheers
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How do i pass the value of Sequence1Length into another method in the same class?



HTH
[ October 31, 2005: Message edited by: Srinivasa Raghavan ]
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah OK but how does it know in your method that 'seqLen' is refering to Sequence1Length?

Cheers
 
Stephen Boston
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I'm understanding you correctly...
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok. Now check this code.

 
Stephen Boston
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your other method you would call..
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everyone. Sorted!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!