Gamestudio Links
Zorro Links
Newest Posts
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
NOMAX undeclared identifier.
by Petra. 01/09/26 21:12
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 01/07/26 15:14
Zorro locks DLL
by jcl. 01/07/26 13:33
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (joe_kane), 6,009 guests, and 14 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joe_kane, Namitha_NN, Syndrela, agasior, mosfet
19189 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