aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1650

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1650  Random access of database files

01/09/2009 @ 01:51
by Roman

Anonymous



The kind of animation found in the Neko Cat example only works if the background is a solid color. In light of this, I've decided to try to store pixel colors in an array so I can restore them after I draw a bitmap over them. Naturally, this requires hundreds of numbers to be stored first.

So, to get to the point, I am having trouble reading these numbers in out of a database. Here's my sample code:

OPEN "pix" FOR RANDOM AS #1
PRINT #1, 17
INPUT #1, A$
CLOSE #1
PRINT A$
KILL "pix"

This is trying to get 17 written in the database, copied to an array, and read out on the screen. I believe the INPUT function is the one I'm having trouble with. Filez shows the "pix" database gains a record (17), but all that is displayed is 0, or "", depending on whether the variable is A or A$.

Perhaps I've said too much :D
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
01/09/2009 @ 15:42
by Roman

Anonymous

visitor
Well, the amateur has solved his own problem. The reason that A$ was only returning zero or nothing was because the record was blank... the last record that is, the one that A$ was being assigned to. To fix the problem, I amended it to the following:

PRINT #1, 17
SEEK #1, 1 'go to 1st record
INPUT #1, A$ 'read current record

Before, I was reading a blank, end of file record. That's all, folks.
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2
--------
01/09/2009 @ 21:57
by aldweb

Anonymous

visitor
Hello Roman,

I am not sure that your way of proceeding will be the most efficient one in terms of speed.
Have you considered adding a background image, eventually by small squares, so that you would only redraw before drawing back your image on top of the background?
Or you might also use the SAVESCREEN and RESTORESCREEN statements?

Cheers,
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3
--------
01/09/2009 @ 22:06
by Roman

Anonymous

visitor
As it turns out, that is the route I'm going to need to take. I do like the idea of being able to transform the image's color though.
  Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^