I don't want to but reading all the reply's it shows you have to know a lot more than only "a pointer is a variable holding an address"..
You basically have to know the inner workings of the programming language you use too and that's not like a quick read trough the manual if you ask me :(
Small ...
Search found 112 matches
- Fri Mar 03, 2023 7:38 pm
- Forum: Coding Questions
- Topic: Understanding Pointers Completely!
- Replies: 12
- Views: 2076
- Mon Feb 13, 2023 2:11 pm
- Forum: Coding Questions
- Topic: Understanding Pointers Completely!
- Replies: 12
- Views: 2076
Re: Understanding Pointers Completely!
I see, that's why it's put inside a struct as a normal variable :)
So structure unions always pick the biggest value to make space for, even if you just want to store for example a bite?
Maybe I'm just better of not using pointers and memory allocation to store variables.. I'm looking for a simple ...
So structure unions always pick the biggest value to make space for, even if you just want to store for example a bite?
Maybe I'm just better of not using pointers and memory allocation to store variables.. I'm looking for a simple ...
- Sun Feb 12, 2023 1:27 am
- Forum: Coding Questions
- Topic: Understanding Pointers Completely!
- Replies: 12
- Views: 2076
Re: Understanding Pointers Completely!
Wow, a lot of reply's, good! :p
So it's not as simple as allocating 4 (or 8) bites to a pointer for an integer and afterwards reallocating to the string size?
Also, using structure union doesn't allow strings as types and if you use structure union it's gonna use more memory than needed: "always ...
So it's not as simple as allocating 4 (or 8) bites to a pointer for an integer and afterwards reallocating to the string size?
Also, using structure union doesn't allow strings as types and if you use structure union it's gonna use more memory than needed: "always ...
- Sat Feb 11, 2023 4:45 am
- Forum: Coding Questions
- Topic: Understanding Pointers Completely!
- Replies: 12
- Views: 2076
Understanding Pointers Completely!
I have a few questions on pointers as I'm trying to learn them bit by bit.
To do so while simultaneously solving a little problem I encounter now and then I started a little learning project:
"Use pointers to store variables as variants"
; var = 10 (vbscript syntax used as example)
*variant ...
To do so while simultaneously solving a little problem I encounter now and then I started a little learning project:
"Use pointers to store variables as variants"
; var = 10 (vbscript syntax used as example)
*variant ...
- Fri Dec 09, 2022 12:03 pm
- Forum: Coding Questions
- Topic: point and click
- Replies: 4
- Views: 904
Re: point and click
Nice ideas! Thanks everyone :)
I'm gonna check those out this weekend!
I'm gonna check those out this weekend!
- Wed Dec 07, 2022 3:13 pm
- Forum: Coding Questions
- Topic: point and click
- Replies: 4
- Views: 904
point and click
how would you guys go about clicking on a non rectangular object in a 2D game?
let's say I want the mouse arrow to change only when I hover above a pixel of a partially transparant image..
2D array with pixel coordinates?
Getting the pixel color of a separate bitmap that's black and white? (no idea ...
let's say I want the mouse arrow to change only when I hover above a pixel of a partially transparant image..
2D array with pixel coordinates?
Getting the pixel color of a separate bitmap that's black and white? (no idea ...
- Sat Nov 12, 2022 9:32 pm
- Forum: Coding Questions
- Topic: saving image handle to list not working as expected
- Replies: 13
- Views: 1752
Re: saving image handle to list not working as expected
I mean I don't use #PB_any :)
and I reassign the map()\image part when I reload an image but in the helpfile it says unloading is not needed (automatically)
and I reassign the map()\image part when I reload an image but in the helpfile it says unloading is not needed (automatically)
- Sat Nov 12, 2022 8:45 pm
- Forum: Coding Questions
- Topic: saving image handle to list not working as expected
- Replies: 13
- Views: 1752
Re: saving image handle to list not working as expected
- An object that is associated with an index is automatically freed when reusing that index.
so replacing an image e.g. image 0 to another .bmp file wil not create a memory leak if I understand correctly?
I don't use #PB_Any in my original code, the index is stored in the map to change the image ...
so replacing an image e.g. image 0 to another .bmp file wil not create a memory leak if I understand correctly?
I don't use #PB_Any in my original code, the index is stored in the map to change the image ...
- Sat Nov 12, 2022 7:47 pm
- Forum: Coding Questions
- Topic: saving image handle to list not working as expected
- Replies: 13
- Views: 1752
Re: saving image handle to list not working as expected
So an image handle can randomly change in memory?
I thought handles were static? Sort of a constant so to, speak until released / altered?
Or do you mean something else?
I thought handles were static? Sort of a constant so to, speak until released / altered?
Or do you mean something else?
- Sat Nov 12, 2022 6:21 pm
- Forum: Coding Questions
- Topic: saving image handle to list not working as expected
- Replies: 13
- Views: 1752
Re: saving image handle to list not working as expected
But in my program it always returns the windows handle as a result, without imageid()..
debug LoadImage(0, "a.bmp")
debug imageID(0)
The way I load and use the images 'imageID()' is only an unnecessary extra step because it is stored in the map anyway..
I only need to display the images on a GUI ...
debug LoadImage(0, "a.bmp")
debug imageID(0)
The way I load and use the images 'imageID()' is only an unnecessary extra step because it is stored in the map anyway..
I only need to display the images on a GUI ...
- Sat Nov 12, 2022 4:46 pm
- Forum: Coding Questions
- Topic: saving image handle to list not working as expected
- Replies: 13
- Views: 1752
Re: saving image handle to list not working as expected
Woops, okay, first things first..
"Are you sure (as a start) that the next line did not rise any error?"
Sorry about my first code sample here,
it was very late and I made a quick little version of my code for this post to explain the problem.
I misplaced the '()' on the new map, and mistakenly ...
"Are you sure (as a start) that the next line did not rise any error?"
Sorry about my first code sample here,
it was very late and I made a quick little version of my code for this post to explain the problem.
I misplaced the '()' on the new map, and mistakenly ...
- Sat Nov 12, 2022 5:22 am
- Forum: Coding Questions
- Topic: saving image handle to list not working as expected
- Replies: 13
- Views: 1752
saving image handle to list not working as expected
Structure newstruc
info.s
image.i ; save id hande
EndStructure
; Global NewMap imag().newstruc EDIT: made a mistake here while making this post
Global NewMap imag.newstruc()
Procedure load_imgs(name.s)
imag("name")\info = "test"
imag()\image = LoadImage(name + ".bmp")
imag(name + "2")\info ...
info.s
image.i ; save id hande
EndStructure
; Global NewMap imag().newstruc EDIT: made a mistake here while making this post
Global NewMap imag.newstruc()
Procedure load_imgs(name.s)
imag("name")\info = "test"
imag()\image = LoadImage(name + ".bmp")
imag(name + "2")\info ...
- Fri Nov 11, 2022 2:27 am
- Forum: Coding Questions
- Topic: loading sounds, changing and reloading them
- Replies: 5
- Views: 653
Re: loading sounds, changing and reloading them
Nice, thanks :)
Didn't see that in the helpfile first for some reason :shock:
Didn't see that in the helpfile first for some reason :shock:
- Fri Nov 11, 2022 1:32 am
- Forum: Coding Questions
- Topic: loading sounds, changing and reloading them
- Replies: 5
- Views: 653
Re: loading sounds, changing and reloading them
Okay, so how do you know it 'auto unloads' the file actually?
The help file is very limited about such things...
The help file is very limited about such things...
- Thu Nov 10, 2022 10:25 pm
- Forum: Coding Questions
- Topic: loading sounds, changing and reloading them
- Replies: 5
- Views: 653
loading sounds, changing and reloading them
Hi :)
Quick question(s) about the inner workings of the sound system:
If I load a sound and want to replace/reload it afterwards while the program is running, do I first need to unload e.g. sound '0' to replace it?
LoadSound(0, "a.wav")
LoadSound(0, "b.wav")
I also wonder if continuously ...
Quick question(s) about the inner workings of the sound system:
If I load a sound and want to replace/reload it afterwards while the program is running, do I first need to unload e.g. sound '0' to replace it?
LoadSound(0, "a.wav")
LoadSound(0, "b.wav")
I also wonder if continuously ...