Universal variables on the prop
mosquito56
Posts: 387
·· In the programs scogs, which starts each cog and writes a string "....34567" to indicate that cogs 0..2 are being used and 3..7 are free it fills a string called cstr. When I put a string called the same in my main program and call scogs and print cstr in my main program I get "3....4567" This would indicate that the scogs is communicating with· the variable shared with my main program.
· I am trying to duplicate this effect with another variable. I have
dat
varrrr byte "........",0 in both objects
I use
·· repeat x from 0 to 2
···· varrr.byte[noparse][[/noparse]x]:=x+48
printstr(@varrr)
and it's ok.· It prints 012........ which is what is expected
but in my secondary object
y:=57
varrr.byte[noparse][[/noparse]4]:=·y it doesn't change the val when printed
if 2 objects have the same name in the dat section, shouldn't they be "universal variables" I plan to move this to another cog when I finish.
Thanks.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······
······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········
· I am trying to duplicate this effect with another variable. I have
dat
varrrr byte "........",0 in both objects
I use
·· repeat x from 0 to 2
···· varrr.byte[noparse][[/noparse]x]:=x+48
printstr(@varrr)
and it's ok.· It prints 012........ which is what is expected
but in my secondary object
y:=57
varrr.byte[noparse][[/noparse]4]:=·y it doesn't change the val when printed
if 2 objects have the same name in the dat section, shouldn't they be "universal variables" I plan to move this to another cog when I finish.
Thanks.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······
······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········
Comments
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······
······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········