June 11, 2024, 10:22:29 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Problem with unreferenced variable

Started by Andy, December 20, 2015, 02:37:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

This is a strange one,

In the attached code, a program I'm writting (not finished yet, nor is it the best way to do what I want it to), I have a problem with an INT variable -"y".

It's unreferenced, so I removed it from the code.

1. With the variable "y" removed, I get no output on screen.
2. Later down the code, I've used another variable called "yloop", used in a FOR/NEXT loop.

I called it "yloop" as when I tried to simply use "y" the output doesn't work, hence "y" is unreferenced an needs to be removed.

Why am I having these problems with variable "y"?

I've even tried it with AUTODEFINE "OFF", still the same problems as above.

Could someone cast their eye over my code please.

Very strange!

Thanks,
Andy.



Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

aurelCB

It looks ok for me
even u use little bit strange method in comparison

mid$(TheString,1,len(TheText)) <> TheText

/ i learn that when i use another compiler /

all in all i can compile program with EB 1.73

LarryMc

I got rid of yloop and just used the y variable
I appears there was some sort of hidden character or something after the definition of the y variable.
I merged it and the following line and all's well in the world with with your code without yloop.

I had run into the sort of thing once before and it ate my lunch for days.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Thanks Larry,

That was the only conclusion I could come to after thinking about it for some time.

Thanks,
Andy,
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

I deleted line 8 (a blank line - or was it?)
Deleted line 9,
Defined variables x and searchstring on a new line (after the other defines)
Did the same again for variable MyCount.

Everything now works as it should with variable "y" removed, or using "y" in the FOR/NEXT loops.

So, Larry you were right (again!), there must have been some sort of hidden character.

Thanks everyone for looking at it, I was beginning to doubt my own sanity!

Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.