I've always wondered why the Thread Starters never provide enough details of their projects.
And another detail is that they don't read either, for example in this thread
The user in post#3 give a beautiful answer and the Thread starter answer was xD. Well, you better check it out on that thread.
And on top of that he comes to demand (post#17):
I always take notice of any advice given on this forum. I received a suggestion as to why my code was not compiling. It was that I did not put a return type in. So I then put in 'int return'. This also didn't compile. It is apparent that you do not test this code out yourself or you would know this.
I also explained the second point you bought up. The variable was being updated all the time from the rest of my code which was not shown. It was not stuck in the while loop forever.
Please suggest a code that will work for a subroutine call. Then test it yourself to make sure it compiles. Make it simple. Just call a subroutine to return a specific value.
Something like this;
sub1;
y=(x*2);
sub1{
x=5;
return (x)}
Do the correct coding for this. You always point out my mistakes but never suggest a sketch that will compile.