×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

DIMing

DIMing

(OP)
I need some help i need too DIM an array that has a 65535 subscript. Is there any possible way too pass the usual DIMing limit (32676 I think it is)?

RE: DIMing

yes using '$DYNAMIC

RE: DIMing

(OP)
Really......how? And will that let me get up to 65535?

RE: DIMing

Nope, I'm wrong, sorry about that.  Why do you need to go up to 65535, becuase the only way to do it would be by using single byte strings DIM a(65535) AS STRING * 1, it takes up the same memory as a%(32676), but each block is half as big.

RE: DIMing

(OP)
You see I'm making an NES library. The registers are 8-bit, but the memory addresses are 16-bit and thus in qbasic I needed to make a simulation of all of the NES memory addresses which would make it up to 65535 and i figured that it was possible because integers in qbasic are 16-bit I thought there was maybe someway to do it if i could make it unsigned. I was testing  using the /ah and '$DYNAMIC hoping i could get that high, but couldn't. But when i was experimenting i was wondering why DIM memaddress(0 to 319, 0 to 199) worked yet Dim memaddress(64000) didn't. Although thats not what i need. Is there anyway to make it unsigned so that that it will go from 0 to 65535 instead of -32768 to 32767. I was looking through the qbasic help file and found that constant integer decimals are signed so they have the optional of being - or +, but Hexadecimal numbers are unsigned. Does that work the same with non constants? Thx for your help so far.

RE: DIMing

Nintendo Entertainment System?  Classic, some things are better in the original.  Snake Rattle and Roll is the best game ever.  
So anyway, you could use an XMS or EMS library, or you can look at the FAQ called "how can I get more conventional memory".

RE: DIMing

(OP)
Yeah, the Nintendo Entertainment System. I thought making a would make NES programming easier, but then i decided that I should sort of have a simulation of it so that while I'm programming I can run it and see how it'll turn out before I compile it into an NES file. I've heard of ems and xms what exactly does it do? Well thx for your help I'll go look up EMS and XMS.

RE: DIMing

I'd guess it's too late for my reply to be of much help, but if the EMS/XMS thing doesn't pan out (and for me it rarely did-- I hated it! :) ), you could always go the slightly slower route and use a set of wrapper functions to get two arrays to work like one.

Example:

dim array1(32767)
dim array2(32767)

sub setArray(element as long, value as integer)
if element > 32767 then
 array2(element - 32767) = value
else
 array1(element) = value
end if
end sub

function getArray%(element as long, value as integer)
if element > 32767 then
 getArray% = array2(element - 32767)
else
 getArray% = array1(element)
end if
end function





...like I said, a bit slow, but if the XMS/EMS thing turns out to be more trouble than it's worth, it's a possibility. :)

RE: DIMing

oops, that should be dim shared. :/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close