Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - ckrum

#1
I have a problem which probably has a very simple answer however I have been unable to find it.
Here is some simple code to illustrate the problem.
This code creates an array 80x80 with data.
This program will fail as it begins to run.
It wont get to the first mousewait.
I need help to understand how to create an array and yet still be able to run.
I have changed this up a lot of ways.. the common denominator to failure is to try and use the array.
Code (glbasic) Select
// --------------------------------- //
// Project: omgbug
// Start: Tuesday, October 15, 2013
// IDE Version: 10.283


// SETCURRENTDIR("Media") // go to media files

GLOBAL ArrayHeight%,ArrayWidth%,grid%,myarray[]

DIM myarray[ArrayHeight%][ArrayWidth%]

ArrayHeight% = 80
ArrayWidth% = 80

LOCAL a%,b%
FOR a%=0 TO ArrayHeight%

FOR b%=0 TO ArrayWidth%

myarray[a%][b%] = "Data"

NEXT
NEXT

PRINT "The array has data",100,100

SHOWSCREEN
MOUSEWAIT

FOR a%=0 TO ArrayHeight%

FOR b%=0 TO ArrayWidth%

myarray[a%][b%] = ""

NEXT
NEXT

PRINT "The array is empty",100,100

SHOWSCREEN
MOUSEWAIT


#2
I can even see the graphics in the debug apk file .. they are there .. the font .. the background and the sprite..
The graphics show up when I run the program on the PC.
I fail to get the font, background or sprite to show on the android.

#3
FAQ / ENDIF without IF
2013-Sep-29
Feeling like a newb
Here is the code..
IT PRODUCES AN ERROR - ENDIF without IF
THE 'IF' STATEMENT IS CLEARLY PRESENT SO IS THIS A BUG?
// --------------------------------- //
// Project: omgbug
// Start: Saturday, September 28, 2013
// IDE Version: 10.202
// SETCURRENTDIR("Media") // go to media files

DIM mynumber%[6]
//create an array of numbers for sort
mynumber%[1] = 5
mynumber%[2] = 3
mynumber%[3] = 1
mynumber%[4] = 2
mynumber%[5] = 6
mynumber%[6] = 4

//bubblesort the array
FOR a% = 1 TO 5
   FOR b% = a%+1 TO 6
       IF a%<>B% AND mynumber[a%] > mynumber[b%] THEN   
           memory%=mynumber%[b%]
          mynumber%[b%]=mynumber%[a%]
          mynumber%[a%]=memory%       
      ENDIF   
   NEXT
NEXT

FOR i%= 1 TO 6
PRINT i% + " " + mynumber%[i%], 100 + (i%*20),100
NEXT