The Daily Click ::. Forums ::. Klik Coding Help ::. Trying to get string to file opening..
 

Post Reply  Post Oekaki 
 

Posted By Message

hapsi



Registered
  13/11/2003
Points
  775
20th February, 2007 at 10:32:17 -

start of frame -- event: set text to: appdrive$ + appdir$ + string of$( "loader ini" )
what text box shows: c:\game directory\

The string of "loader ini" is "music.mp3" so why the result is not c:\game directory\music.mp3


 
[Signature][/Signature]

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
20th February, 2007 at 11:15:04 -

You say that "loader ini" is a String, but that function (and its name) imply an INI object - which is it?

 
http://www.davidn.co.nr - Games, music, living in America

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
20th February, 2007 at 12:14:51 -

Are you using TGF? string of$( "loader ini" ) is an old function TGF used. If you have MMF, use GroupItemString$( "Ini", > Enter string here <, > Enter string here < )

With the old ini functions, things are a little more tricky.
Say you have an ini file c:\game directory\loader.ini and I assume the settings of the loader ini object are correct. And let's say the contents of the loader.ini is:
[musicGroup]
musicItem=music.mp3

Before you use the function string of$( "loader ini" ) you must set the current group to "musicGroup" and set the current item to "musicItem".

Image Edited by the Author.

 
This space is for rent

hapsi



Registered
  13/11/2003
Points
  775
22nd February, 2007 at 04:57:41 -

I have tested that the string really is "music.mp3" with this event: Allways - set textbox text to the string of ini--> textbox shows text "music.mp3". Allso i can get "c:\gamedir\" to the textbox but i can't combine them. Is there any solution to put them together?

And yes im using tgf.

 
[Signature][/Signature]

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
22nd February, 2007 at 06:43:57 -

That's wierd, and I don't know why that's happening, but I guess the solution is to load the string from loader ini into a string object then combine appdrive$ + appdir$ with the contents of the string.

 
n/a

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
22nd February, 2007 at 17:54:36 -

Using strings and values directly from an INI could be slightly dodgy (or not work at all) on earlier versions - I only noticed this once when using MMF1.2, I think, but it's possible it's the same problem.

 
http://www.davidn.co.nr - Games, music, living in America

Bibin

At least 9001

Registered
  01/07/2005
Points
  308

Silver Cup WinnerGOTW Winner!Has Donated, Thank You!VIP Member
23rd February, 2007 at 00:34:56 -

"appdrive$ + appdir$" Never worked for me, and it isn't really necessary. If you just use loader.ini by itself it should work.

 
n/a

Bibin

At least 9001

Registered
  01/07/2005
Points
  308

Silver Cup WinnerGOTW Winner!Has Donated, Thank You!VIP Member
23rd February, 2007 at 16:38:54 -

I did it exactly as shown above, and instead I got a file named "appdrive$ + appdir$ + whatever.ini" in the directory of my game.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
23rd February, 2007 at 18:32:38 -

Hahahaha.

 
n/a

Deleted User
23rd February, 2007 at 18:33:16 -

Haha x)

 

hapsi



Registered
  13/11/2003
Points
  775
28th February, 2007 at 12:30:57 -

Actually the event of the condition is (dmc2 object): appdrive$ + appdir$ + string of$( "level settings loader" )

I cant put it in quotes --> appdrive$ + appdir$ + "string of$( "level settings loader" )"

 
[Signature][/Signature]

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
28th February, 2007 at 16:09:58 -

Haha, what's with all the appdrive$ + appdir$ if you can use "./" for stuff like this?

 
Old member (~2004-2007).
   

Post Reply



 



Advertisement

Worth A Click