not sure i was very clear last night. apparently not.
gonna try better this time
this is not part of a menu system but imagine it is. same concept except that im going to need to know mabey 10 minutes down the line what item on my menue whas selected
the ab bb an cb are starting position on screen where i want my sprite to start at for highlighting selecting
as i move my mouse down the menue if its above of below 15 pixels from its revious point the sprite will move there
ab#=146
bb#=161
cb#=146
for cib =1 to 7
if mousey() >ab# and mousey() < bb#
`sprite will move there!! sprite 46,1143,
[b]cb#[/b],33
all this is fine and good
now i got a for next loop here activated buy mouseclick
so when the mouse is clicked it will run the loop and cb# will
pick the current mouse position mousse starting pos =ab# or 146+ 15 x how many places it has moved so i can assign primobj# a value bases off the current cb# number.
all this works fine and i can print the variable cb# to the screen or even have it type 1-7 or select an item 1-7 ect or have it do something
however the problem is that if i want to call the variable cb# somewhere else in my program for use unless the mouseclick=1 and is over my menue ect the variable doesnt seem to retain its previous value only while its in the loop
want to be able to call primobj# with = cb# value
but it returns a 0 if its not inside the funstion im using
hope this is explanation enough sorry best i can do im very new to coding and how it all works
i did get it working buy throwing a function into my function so techincally its still in the loop but my question remains other than opening a file to write data to is there a way to store data and keep it from changing even if the value of the variable witch the data came from was changed
if mouseclick()=1
ab#=146
bb#=161
cb#=146
for cib =1 to 7
if mousey() >ab# and mousey() < bb#
sprite 46,1143,cb#,33
if cb#=146 then primobj#=1
if cb#=161 then primobj#=2
if cb#=176 then primobj#=3
if cb#=191 then primobj#=4
if cb#=206 then primobj#=5
if cb#=221 then primobj#=6
if cb#=236 then primobj#=7
primobj$=str$(primobj#)
endif
inc ab#,15
inc bb#,15
inc cb#,15
next cib
endif
cant do it global i dont think grob grog it doesnt have a definite value its changing several times a loop
did try it though through primobj as a global didnt work oustide the function
and ty LBFN for the indent info ill use it form now on will meak it easier for my if statments i got thousands of them get lots alot as far as the float goes ive never had an issue using it but have had not using it so i just stick with it for now for what i do most it suites me
A child's dream never dies.