Quote...and it's slow as molasses running uphill compared to other languages.Hey, it's much better than it used to be. I would describe it now more as a soapy water concoction, great for cleaning but hard to swallow.
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 MenuQuote...and it's slow as molasses running uphill compared to other languages.Hey, it's much better than it used to be. I would describe it now more as a soapy water concoction, great for cleaning but hard to swallow.
Quote
LOCAL a[]
DIM a[4][5]
...
REDIM a[7][7]
Like this?
Quote from: Ruidesco on 2011-Dec-16
Yes, in Java you don't have real multidimensional arrays. What you do to simulate them is creating an array in which every position contains another array, and thus you can refer to them the same way you do with 2d arrays in GLBasic or C. Since they are independent from each other, every sub-array can have a different length.
As far as I know you can't have an "array of arrays" in GLBasic.
public class Test {
public static void main(String[] args){
int [][] a=new int [4][5]; //Creating the initial array of 4x5
a[0]=new int[6]; //Resizing an array inside of the 2d array
System.out.println(a[0].length); //This will print 6.
System.out.println(a[1].length); //This will print 5
System.out.println(a.length); //This will print 4
}
}
Quote from: aroldo on 2011-Sep-29Here is your problem. This should be:
IF (st)
if (st=true)
Quote from: Minion on 2011-Aug-11Thanks, I feel stupid, I've been doing this for a while now, and hadn't noticed anything? Well, at least this explains a few errors I've been having with my program
If you use the BYREF command, then you can alter the value, otherwise all you are throwing into the function is a copy
Global B;B=10
AddOne(B)
Print B,0,0
Showscreen
Mouswait
Function AddOne:A
A=A+1
endfunction
Quote from: Serpent on 2011-Jul-17Thanks, this is more of what I was looking for, as I knew Glbasic copied a backup somewhere, I just didn't know where. Thanks
Extracting one of the updater's backups seems to work for reverting as well (see the program files folder).
Quote from: Serpent on 2011-Jul-16This does indeed fix the compiling issue, however the app crashes prior to even executing one line of user code.
Changing that line:int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
to thisint keyboardPresent = (getResources().getConfiguration().keyboard != android.content.res.Configuration.KEYBOARD_NOKEYS) ? 1:0;
workscompiles (edit: ok haven't run it)...
(http://developer.android.com/reference/android/content/res/Configuration.html#KEYBOARD_NOKEYS)
BTW does GLB compile the app twice?
Quote from: Serpent on 2011-Jul-16Indeed I can confirm this, the app crashes while loading.
That seems right. Could have sworn I used to see two "BUILDSCRIPT"s in the output...
Anyway it seems Android apps (even Hello World) won't run with 10.051. It compiles (with the slight addition to SDLActivity.java), installs, and force closes when the app is opening.
GLOBAL Rnum#
DIM sprArray%[640*480]
//SetPixel Method
Regen:
IF KEY(16) THEN END
FOR I=0 TO (640*480)-1
Rnum#=RND(100)
IF Rnum#=2 THEN SETPIXEL RND(640),RND(480),RGB(255,255,255)
NEXT
PRINT "SetPixel Method",0,0
SHOWSCREEN
IF KEY(30) THEN GOTO RegenB
GOTO Regen
//Mem2Sprite Method
RegenB:
REDIM sprArray%[640*480]
IF KEY(16) THEN END
FOR I=0 TO (640*480)-1
Rnum#=RND(100)
IF Rnum#=2 THEN sprArray%[I]=INTEGER(0xffffffff)
NEXT
MEM2SPRITE(sprArray%[],0,640,480)
DRAWSPRITE 0,0,0
PRINT "Mem2Sprite Method",0,0
SHOWSCREEN
REDIM sprArray%[0] //fastest way to reset everything back to 0
IF KEY(30) THEN GOTO Regen
GOTO RegenB