Steve Mynott Posted February 17, 2016 Share Posted February 17, 2016 I'm trying to declare and initialize an int like int foo=[-1] and just get Error: Not a constant int foo=[-1] Error: 9 Any ideas? Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted February 17, 2016 Share Posted February 17, 2016 I couldn't find anything in the manual, but it appears to work if you declare int foo separately from setting its value. INT foo foo=-123 PrintIE(foo) works. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted February 17, 2016 Share Posted February 17, 2016 What are the square brackets for? Do they not attempt to define an array of negative size? Does int foo=-1 not work? Quote Link to comment Share on other sites More sharing options...
+Ripdubski Posted February 17, 2016 Share Posted February 17, 2016 What are the square brackets for? Do they not attempt to define an array of negative size? Does int foo=-1 not work? value assignment through declaration Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted February 17, 2016 Share Posted February 17, 2016 value assignment through declaration Yeah: and clearly not an array declaration either. D'Oh! Quote Link to comment Share on other sites More sharing options...
ricortes Posted February 18, 2016 Share Posted February 18, 2016 Convoluted logic on my part. Probably Mr. Parker was so focused on getting the indirection and pointer thing right that it took priority over what should have been an obvious option with a 16k cart. It probably could be fixed if people can't tolerate the work around Kyle presented. The indirection/pointer thing. Proc Main() Byte Right_Margin=82, My_Margin=[0] ;Right_Margin refers/points to memory location 82, My_Margin is a byte somewhere in memory whose location is decided by the cart and initialized to the value 0 Right_Margin=My_Margin ;Uses the pointer Right_Margin to store the value of My_Margin<0> in memory location 82 Return So things like memory location -1 weren't really a priority to implement in declarations since it sort of doesn't exist other then by wrap. 16k [compiler, editor, runtime] space problem. Matter of fact, if you are a professor of computer science, you may have even left it out/made it an error on purpose. It is one of the reasons why I like Action since there is still a way to do what you want to do, you just have to be serious about it and really mean it! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.