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

Messages - Ian Price

#3961
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 :)
#3962
Not fixed yet ;)
#3963
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?
#3964
Bug Reports / Type bug
2008-Jan-03
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 :)
#3965
Bug Reports / Type bug
2008-Jan-03
That's sorted it. Cheers :)
#3966
Bug Reports / Type bug
2008-Jan-03
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
 x
 y
 num
ENDTYPE

GLOBAL tt[] AS test_type

DIM tt[100]

FOR n=0 TO 10
 create_test(n)
NEXT

main()

END


// Main
FUNCTION main:
 WHILE TRUE

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

  render_test()

  SHOWSCREEN
 WEND
ENDFUNCTION


// Create test Type
FUNCTION create_test: n
 tt[n].num=n
 tt[n].x=5
 tt[n].y=5
ENDFUNCTION


// Render Test Types
FUNCTION render_test:

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

ENDFUNCTION
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?
#3967
I use something like this
Code (glbasic) Select
WHILE TRUE

IF KEY(??) AND press=0
 x=x+1
 press=10
ENDIF

IF press>0 THEN press=press-1

PRINT "X="+x,100,100

SHOWSCREEN

WEND
#3968
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. :)
#3969
Cheers Gernot - that did exactly what I wanted :)
#3970
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?
#3971
Reinstall? Web-update? Silly suggestions, and I'm sure you've considered both.

The "Hello World" program definitely works.
#3972
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?
#3973
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?
#3974
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.

USAGE -

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)

DRAWSPRITE 1000,0,0

GETSPRITESIZE 1000,sizex,sizey

n=start_num
x=0
y=0

WHILE n
GRABSPRITE n,x,y,width,height

n=n+1

x=x+width

IF x>sizex-width
 x=0
 y=y+height
ENDIF

IF KEY(1) THEN RETURN

WEND

ENDFUNCTION