TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: KROGG
date: 1998-03-05 07:26:00
subject: Re: pointers:help

From: Krogg 
Subject: Re: pointers:help
 
Krogg wrote:
>
> I am using trypb32 and have ordered 3.5 for dos.(waiting for it
> to come in mail :) )
>
> What i want to do is make an array that is 100x100 and
> store the address for a 100x100 section of the mode 13h
> vga screen.then i can do like
> "@scrn(x,y)=pixelcolor"
> the help file says that pointers are faster than poke and peek
> and using an array would be faster than
> saying "poke 320*y+x" anyhow cause it would eliminate a multiply
> and an add.
> I tryied doing like
> -----------begin code-----------------
> dim dynamic scrn(100,100) as byte ptr 'dim pointer array
>
> for x=1 to 100                        'store addresses
> for y=1 to 100                        'in array
> scrn(x,y)=(y*320+x)+&ha0000000        '(y*320+x) predone,sneeky huh?
> next x
> next y
>
> asm mov ax,&h13                       'chained 320x200 256 vga
> asm int &h10
>
> for x=1 to 100                        'show test pattern
> for y=1 to 100                        'It works good enuf
> @scrn(x,y)=y+x                        'dont know if faster yet though
> next y                                'BTW y+x ranges from 2-200 and
> next x                                'its just some diagonal lines
>
> poop:
> a$=inkey$                             'lame loop,but it werks.
> if a$="" then goto poop
>
> asm mov ax,&h03                       'reset normal 80x25 text mode
> asm int &h10
> cls
> ?"done"
>
> end
> -----------end code--------------------
> Hey it works great,but.
> I cant get it to make the array 320x200 (319,199)
> can some one help?
> acutualy i cant get much bigger at all,I get
>  "dim dynamic scrn(100,100) as byte ptr"
..         should be (200,100)
> Error 9: Subscript out of range
>  I tryied
> dim huge scrn(100,100) as byte ptr
..again         (200,100)
> and i get "Out of memory" (could it be win95 killing me?)
> dim absolute ect......... doesnt help either
> Please tell me there is a way.I know this must be lame
> but I am stumped.I hope my copy of 3.5 gets here quick
> cause i bet Chapter 5 of the User's Guide as the help
> file says could help.But am i just hope less?
>
>  Any help diming big arrays at all would help too :).
>
sorry for typos
 
> --
>                       THE
>                   
>         /\         \\     //         /\
>        /  \         \\   //         /  \
>       / /\/        /""""""\         \/\ \
>      / /  SEE HIS (  /   \ \  SEE HIS  \ \
>      \ \   FACE    \/ \/   SMILE   / /
>       \ \          /   W   \          / /
>        \ \        /\_|||||_/\        / /
>        /  \      //   |||   \\      /  \
>       / /\ \    //     '     \\    / /\ \
>      / / / /      \ \ \ \
>      \ \/  \_______________________/  \/ /
>       \_________________________________/
>          krogg.no.to.spam@inspace.net
>           Remove no.to.spam to reply
>  http://www.inspace.net/~carcher/krogg/aani.htm
>   Gory javascript animations for your enjoyment
 
--
 
*** QwkNews (tm) v2.1
 * [TN71] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.