Ok, I know this is small to start, but I had a question for something, can't seem to figure out a good way.
BASIC Code wrote:
:ClrHome
:Input "WIDTH: ",A
:Input "HEIGHT: ",B
:{A,B→dim([A]
:Disp [A]
:Pause
Generated by SourceCoder, © 2005-2010 Cemetech

I was wondering how I could store the width and height to a variable so that I can have it edit the matrix column by column and not go over the defined width and height. Any Ideas or suggestions?
Did you have something like this in mind? Please also note where I changed your dim statement to be correct (it's {rows,columns}, not {columns, rows}).


Code:
:DCS
:"81C3A59981818181
:ClrHome
:Input "WIDTH: ",A
:Input "HEIGHT: ",B
:{B,A→dim([A]
:For(C,1,A
:For(D,1,B
:ClrHome
:Disp "COL[4 spaces], ROW
:Output(1,5,C
:Output(1,14,D
:Input "=",X
:X→[A](D,C
:End:End
KermMartian wrote:
Did you have something like this in mind? Please also note where I changed your dim statement to be correct (it's {rows,columns}, not {columns, rows}).


Code:
:DCS
:"81C3A59981818181
:ClrHome
:Input "WIDTH: ",A
:Input "HEIGHT: ",B
:{B,A→dim([A]
:For(C,1,A
:For(D,1,B
:ClrHome
:Disp "COL[4 spaces], ROW
:Output(1,5,C
:Output(1,14,D
:Input "=",X
:X→[A](D,C
:End:End

Ok, could you explain how to use the DCS, I read about it, but it didn't make too much sense. Is it 3 variables, or a command used to add in DCS7?
You mean the DCS header? There's various types of Doors CS headers for BASIC programs, but they all provide one or more of three major features:

1) A custom icon
2) A custom description (that you can see via InfoPop)
3) Automatic unarchiving/archiving of subprograms

What I added is just a custom icon, feature (1) above. It's a capital M for Matrix, as in Matrix Generator. If you read through the first link below, it will tell you about the headers. The second link below will show you how to turn an 8x8 icon into that odd string of hexadecimal:

http://dcs.cemetech.net/index.php?title=BASIC_Header
http://www.cemetech.net/forum/viewtopic.php?t=4784
A=5
B=5
C=0
D=0
X=12345
Error # 518
Basic Ex ERR:DIM

When I hit goto, it takes me to this line:
X->[A](D,C

If anymore information is needed let me know.
You can't store to a matrix at 0,0
the first location is 1,1.
ERR:DIM is a dimension error just so you know
_player1537 wrote:
You can't store to a matrix at 0,0
the first location is 1,1.
ERR:DIM is a dimension error just so you know
Yeah, that means you mis-copied my code, and used For(C,0,... and For(D,0,... instead of For(C,1,... and For(D,1,... Smile
_player1537 wrote:
You can't store to a matrix at 0,0
the first location is 1,1.
ERR:DIM is a dimension error just so you know

I know DIM is a dimension error, and I just copied the post KermM made, but if it was the location that caused the error, wouldn't it be a DOM error?
Domain errors are for things like trying to output at 0,0 or 9,17. Or trying to access a part of a string that you can't (0 or length(str)+1)
_player1537 wrote:
Domain errors are for things like trying to output at 0,0 or 9,17. Or trying to access a part of a string that you can't (0 or length(str)+1)
Indeed. Sonlen, did you double-check that you copied my code correctly, as per my post a few minutes ago? Smile
How about on the graphscreen beyond the set window size?
Sonlen wrote:
How about on the graphscreen beyond the set window size?
Indeed, something like Pxl-On(99,99 would cause a DOMAIN error. Of course, Pt-*( commands would not do so.
Not trying to be mean, but I don't think it really matters what gives what errors, I personally think dim/dom interchangably. If I get one, I know I'm trying to go out of bounds of something.
BASIC Code wrote:
:DCS
:"81C3A59981818181
:ClrHome
:Input "WIDTH: ",A
:Input "HEIGHT: ",B
:{B,A→dim([A]
:For(C,1,A
:For(D,1,B
:ClrHome
:Disp "COL , ROW
:Output(1,5,C
:Output(1,14,D
:Input "=",X
:X→[A](D,C
:End:End
Generated by SourceCoder, © 2005-2010 Cemetech



KermM, you really need to test this, I can't quite figure out how to explain what it does >.<

Nevermind, I figured it out >.<
It prompts for the dimensions, then iterates over all the columns. For all the rows in that column, it prompts for a value for that (row, column) cell, then stores it.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement