Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Procedure Issue?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Hasassin




PostPosted: Wed Jun 10, 2009 7:22 pm   Post subject: Procedure Issue?

Hey everyone, I'm making a Resident Evil remake on turing for a school project on Turing.

I've ran into one annoying issue that i want to get over with. It is the procedure.

I've declared it, and setted it up and it works, however, when i'm playing around in my game with the oval (character), an error comes up where the procedure is declared. It says :

Get attempted on incompatible stream number 0. And this is the code:

procedure background
open : stream, fileID, get, mod

for y : 1 .. 40
for x : 1 .. 40
get : stream, re1 (x, y)
end for
end for

for y : 1 .. 40
for x : 1 .. 40
drawfillbox (y * 10, x * 10, y * 10 + 10, x * 10 + 10, re1 (x, y))
end for
end for

end background

And the reason i'm doing this is that i'm redrawing the background while i move my character, due to the fact that it deletes my background for my game.

If anyone can help, it would be greatly appreciated.

Thanks.
Sponsor
Sponsor
Sponsor
sponsor
tjmoore1993




PostPosted: Wed Jun 10, 2009 8:42 pm   Post subject: RE:Procedure Issue?

Turing:
close : stream


It is good practice to close the stream after you have finished with retrieving or sending information.

Turing:
procedure background
    open : stream, fileID, get, mod
    for y : 1 .. 40
        for x : 1 .. 40
            get : stream, re1 (x, y)
        end for
        close : stream
    end for
    for y : 1 .. 40
        for x : 1 .. 40
            drawfillbox (y * 10, x * 10, y * 10 + 10, x * 10 + 10, re1 (x, y))
        end for
    end for
end background
Kharybdis




PostPosted: Wed Jun 10, 2009 8:57 pm   Post subject: RE:Procedure Issue?

Your error means that the assignment statement for your file to assign an integer value for it has declared the file number to be 0 or negative.

I would look around to see if you have your file somehow messed up.

I would also follow tjmoore's advice on closing the stream number.
copthesaint




PostPosted: Thu Jun 11, 2009 2:24 am   Post subject: RE:Procedure Issue?

I Suggest that you close the file If that's what your opening... You are getting the error because you have your max number of files available to be open.
Hasassin




PostPosted: Thu Jun 11, 2009 6:43 pm   Post subject: Re: Procedure Issue?

I solved the problem, it's fixed but i have another usual. Im redrawing my map everytime I move my character in my game and it flickers like crazy.

I used View.Update, no point, it doesn't help, it still flickers.

Is there any way to make images still yet use a loop?
TheGuardian001




PostPosted: Thu Jun 11, 2009 7:41 pm   Post subject: Re: Procedure Issue?

Without seeing your entire code, there's no way to know exactly what your problem is, however the most likely problems:

-Are you using Processes? If yes, stop.
-How many times are you calling View.Update? You should only be doing it once.
-Did you use View.Set("offscreenonly") or setscreen("offscreenonly")?
-Are you making sure your View.Update is after you've drawn absolutely everything?

Check and make sure it's not one of those, if not, you're probably gonna have to post the entire thing so we can see how the program runs.
x30Jx




PostPosted: Thu Jun 11, 2009 9:31 pm   Post subject: RE:Procedure Issue?

how did you fix it without having declard the stream number integer?
;(
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: