• Print

Author Topic: "Out Of Memory"  (Read 709 times)

Pete

  • Moderator
  • Hero Member
  • *****
  • Posts: 6240
  • Cuz I sez so varmint!
Re: "Out Of Memory"
« Reply #30 on: April 23, 2012, 09:21:34 AM »
Dammit Clippy, keep up, didn't Galleon tell you to add that to the WIKI?

DOSUB "New QB64 Keyword that pokes all of statements written and stored with _MEM into a virtual sub that doesn't exist in your code."

Pete  ;D

PS Actually, I almost never proof anything I type, but when I make that many typos in so few sentences, it is from typing in the dark. I never learned how to type, so I do rely of glancing down at the keyboard, and in the dark, that gives me fits at time. It's just too funny to edit, so I'm going to rely on pitt figuring it out.
It's only rocket science; it's not Linux!

pitt

  • Full Member
  • ***
  • Posts: 243
    • Email
Re: "Out Of Memory"
« Reply #31 on: April 23, 2012, 01:25:12 PM »
Quote from: Pete on April 23, 2012, 08:40:41 AM
Why do ypu have a RETUN in a sub, when there is no DOSUB statement? If you forgot and moved this from a GOSUB routine to a SUB, then you need to change...

Aye, I missed that, but corrected it before you posted and the result is still the same - black screen and program unresponsive. I think it has something to do with passing the image arrays (workscreen(1) & backscreen) back/forth. QB64 doesn't seem to pass it from the CALL draw_ab & SUB/END SUB ; I could be mistaken.

SkyCharger001

  • Hero Member
  • *****
  • Posts: 1594
Re: "Out Of Memory"
« Reply #32 on: April 23, 2012, 01:43:57 PM »
something I sometimes do when dealing with complex routines:
1 create one textmode 'image'.
2 set SCREEN to textmode 'image'.
3 write number identifying section of routine to SCREEN.
4 note value displayed when program slows down and/or crashes.

this allows me to track down the more critical problems.

« Last Edit: April 23, 2012, 03:18:55 PM by SkyCharger001 »

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: "Out Of Memory"
« Reply #33 on: April 23, 2012, 02:32:29 PM »
Quote from: SkyCharger001 on April 23, 2012, 01:43:57 PM
something I sometimes do when dealing with complex routines:
1 create one textmode 'image'.
2 set SCREEN to textmode 'image'.
3 write number identifying section of routine to SCREEN.
4 note value displayed when program slows down.

this allows me to track down the more critical causes of slowdown.

HUH?  ???
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

pitt

  • Full Member
  • ***
  • Posts: 243
    • Email
Re: "Out Of Memory"
« Reply #34 on: April 23, 2012, 02:47:31 PM »
Quote from: SkyCharger001 on April 23, 2012, 01:43:57 PM
something I sometimes do when dealing with complex routines:
1 create one textmode 'image'.
2 set SCREEN to textmode 'image'.
3 write number identifying section of routine to SCREEN.
4 note value displayed when program slows down.

The original problem had nothing to do with slowing down; the program would crash after calling the first draw_ab: I posted after a few hundred thousand calls apparently due to memory issues. Not being able to figure out why it takes up RAM for each call I took some advice and put it into a SUB routine, however the screen now stays black and the program doesn't respond. I have noticed the image handle workscreen(1) isn't being passed from the CALL draw_ab: and then returned from the END SUB. I am wondering what I'm doing wrong; aka - how to properly pass an array from the main program to a SUB routine (second post of SUB draw_ab code). This is what I think is causing the back screen of death.

SkyCharger001

  • Hero Member
  • *****
  • Posts: 1594
Re: "Out Of Memory"
« Reply #35 on: April 23, 2012, 03:23:55 PM »
what about making workscreen(#) DIM SHARED? then you only need to pass the index in the call.

  • Print