Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, AndrewAMD), 14,749 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Get the name of BMAP #150541
08/27/07 16:14
08/27/07 16:14
Joined: Jul 2006
Posts: 150
Deutschland/Germany, nahe Hamb...
dennis Offline OP
Member
dennis  Offline OP
Member

Joined: Jul 2006
Posts: 150
Deutschland/Germany, nahe Hamb...
Hi!

I have got:

"
BMAP* bmap;
bmap = bmap_create("test.png");
"

How can I get the name of the bmap ("test.png") out of my bmap-pointer?

Re: Get the name of BMAP [Re: dennis] #150542
08/27/07 16:58
08/27/07 16:58
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Code:

bmap->link->name


It's a pointer to a char array.


Always learn from history, to be sure you make the same mistakes again...
Re: Get the name of BMAP [Re: Uhrwerk] #150543
08/27/07 19:01
08/27/07 19:01
Joined: Jul 2006
Posts: 150
Deutschland/Germany, nahe Hamb...
dennis Offline OP
Member
dennis  Offline OP
Member

Joined: Jul 2006
Posts: 150
Deutschland/Germany, nahe Hamb...
There's a problem...

Code:
BMAP* mybmap;
char* mychar;

function main()
{
mybmap = bmap_create("Testbild.png");
mychar = mybmap->link->name;
}



error: " 'name': is not a member of" "
...does not make sense

Code:
BMAP* mybmap;
char* mychar;

function main()
{
mybmap = bmap_create("Testbild.png");
mychar = mybmap->link.name;
}



error: application shuts down.
In the acklog.txt I found: "empty pointer in main"


Code:
BMAP* mybmap;
char* mychar[50];

function main()
{
mybmap = bmap_create("Testbild.png");
mychar[0] = mybmap->link.name;
}


That works...but I cannot copy the char into a string of a text...

Re: Get the name of BMAP [Re: dennis] #150544
08/27/07 19:20
08/27/07 19:20
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
The problem is, that you create the bitmap at runtime. name contains only the name of an object, like when you name the object in WED (EDIT: That's just a guess of mine!!). I don't know how to retrieve the filename. Have a look for yourself in atypes.h. The last code you wrote is nonsense. You're declaring an array of 50 char pointers. The second code example should work. Are you sure these lines are producing the crash? Or have anything else behind these lines?

Last edited by Uhrwerk; 08/27/07 19:43.

Always learn from history, to be sure you make the same mistakes again...
Re: Get the name of BMAP [Re: Uhrwerk] #150545
08/27/07 19:27
08/27/07 19:27
Joined: Jul 2006
Posts: 150
Deutschland/Germany, nahe Hamb...
dennis Offline OP
Member
dennis  Offline OP
Member

Joined: Jul 2006
Posts: 150
Deutschland/Germany, nahe Hamb...
Well...you are right.

I have just checked it again..it is working..but the resulting char seems really to be empty...I tried this.

Code:
TEXT* Temp_Txt =
{
flags = VISIBLE;
string = " ";
}
BMAP* mybmap;
char* mychar;

function main()
{
mybmap = bmap_create("Testbild.png");
mychar = mybmap->link.name;
str_cpy((Temp_Txt.pstring)[0],mychar);
}



The error is again: "empty pointer in lite-c"

Perhaps it is really empty bthe bmap is created at runtime.

Re: Get the name of BMAP [Re: dennis] #150546
08/27/07 19:42
08/27/07 19:42
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Yes, of course it's empty as you created the bitmap at runtime. I was just a guess of mine, that it could contain the filename.


Always learn from history, to be sure you make the same mistakes again...

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1