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

Messages - Ian Price

RE: Function - Oooh! So it does! :D

I'd still rather see them on the jumpbar though (as well).

CTRL+SPACE just seems to be a way to create the command TYPE (or other command) rather than actually show Type info, or even jump to the Type. Not very useful (and not even as quick as just typing TYPE), or am I missing something? An actual Types tab on the jumpbar would be much more useful.

Still, the Function thing is handy :)
Not fixed yet ;)
Is there any  chance of updating the IDE to show Function+parameters and Types in the IDE jumpbar?

I know it's quick and easy to just jump to a function to examine, but it would be even quicker to look at the jumpbar and know exactly what parameters are required and the order they are in (I usually use the same format, but some functions require others too, and my memory isn;t what it used to be :P).

A Types jumpbar would also be very useful.

Or is it just me?
Bug Reports / Type bug
I'm more used to dealing with Types in PlayBasic (which appear to be nigh-on identical), where DIM was required for multiple Types.

Never needed DimPush in the past, so wasn't aware of it.

I understand it now though. Thanks to both of you :)
Bug Reports / Type bug
That's sorted it. Cheers :)
Bug Reports / Type bug
I've been working with Types recently and they've been working fine for the most part, but I've discovered what I believe to be a bug.

The code below clearly demonstrates the problem - I create 10 Types, positioning them all at 5,5. In theory every Type should iterate at exactly the same position. However Type[0] ALWAYS appears at position 0,0 - the other Types work fine,

No matter what other fields are in the Type, Type[0] always appears at 0,0 - its other fields are active and work fine though.

Code (glbasic) Select
SETSCREEN 320,240,1

// Test Type
TYPE test_type

GLOBAL tt[] AS test_type

DIM tt[100]

FOR n=0 TO 10



// Main

  DRAWRECT 0,0,320,240,RGB(255,255,255)



// Create test Type
FUNCTION create_test: n

// Render Test Types
FUNCTION render_test:

FOREACH item IN tt[]
 PRINT item.num,item.x,item.y

Is this a bug or a problem with my coding? until now I've been working around it and only displaying Types with a value over zero. But this can't be right. Can it?
I use something like this
Code (glbasic) Select

IF KEY(??) AND press=0

IF press>0 THEN press=press-1

PRINT "X="+x,100,100


You are trying to access a part of the array that hasn't actually been defined - eg you are trying to access the 27th letter of the alphabet! The computer can't find the 27th letter and is telling you that it doesn't exist.

Skimming through your code I found this
Code (glbasic) Select
IF letter = -1 THEN letter = 26Your array only has 26 dimensions (0-25) trying to access 26 is causing the problem. Change that to "letter=25". That should help. :)
Cheers Gernot - that did exactly what I wanted :)
I don't have MingW at all on my system, so I suspect that's not the problem. I believe you've already identified the problem - the home project folder being on your external HD, maybe the required .DLLs and whatever else are stored in that folder too, meaning that they are effectively missing? Dunno.

Reinstall it on your basic set-up and see if it works this time?
Reinstall? Web-update? Silly suggestions, and I'm sure you've considered both.

The "Hello World" program definitely works.
Is it possible to remove program files from the Project Wizard when first starting GLBasic?

I like to create new projects for routines that I want to check, but not necessarily incorporate into my main program (R&D if you like) - this keeps all the standalone work together and allows me to go back to it later on if necessary, however I don't want to see a list of the stuff I've been playing with as it's mainly irrelevant and useless. Is there a way to remove these unwanted files from the Project Wizard?
Quote from: Schranz0rI think there a many better ways to do that !
Thanks for the warm welcome :/

Can you show me a better way then please?
This function allows you to load in a single image/sprite that contains a multiple of same size images (tiles etc.) and then spits out sprites ready to be used - this negates the need for lots and lots of similar image files within a folder and makes everything tidier and easier.

This code is public domain and may be used freely, although a thankyou would be nice.


AnimImage( graphic file name$, the required sprite start#, number of tiles/images, tile width, tile height]

Code (glbasic) Select
// Get tiles
FUNCTION AnimImage: name$, start_num, num_sprites, width, height

LOADSPRITE name$,1000

DRAWRECT 0,0,640,480,RGB(255,0,128)


GETSPRITESIZE 1000,sizex,sizey


GRABSPRITE n,x,y,width,height



IF x>sizex-width