Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / loading file and retreaving file name bluegui

Author
Message
tatts
18
Years of Service
User Offline
Joined: 13th Jan 2006
Location: Ontario,Canada
Posted: 21st Oct 2007 16:53
using blue gui, im trying to write an import function where i can load the object and at the same time save that same object to a media folder within the main program.

Anyway I was able to load and save the file using this code:

function eventImport()

open$=opendialog("Import File","DarkBasic Object (*.dbo)|*.dbo|DirectX (*.x)|*.x|All files(*.*)|*.*",1)
load object open$,obj
position object obj,rnd(100),0,rnd(100)
`inc obj,1

set dir "media"
save object "open$.dbo",obj

endfunction

problem is, it will save exactly like that "open$.dbo".
How do I save the object to dbo but using the objects actual name.

WindowsXP/SP2, Pentium 4 2.66 GHz, 1GB DDR Ram, Geforce 6600 256MB
John Y
Synergy Editor Developer
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 21st Oct 2007 18:48
change it to

save object open$ + ".dbo",obj

Synergy Editor - Available in the WIP forum
tatts
18
Years of Service
User Offline
Joined: 13th Jan 2006
Location: Ontario,Canada
Posted: 21st Oct 2007 20:04
thanks that did work except it did'nt save to the media folder and also it saves a file like such....lamb.x.dbo

to keep the code short I changed it to..........

function eventImport()

filename$=opendialog("Import File","DarkBasic Object (*.dbo)|*.dbo|DirectX (*.x)|*.x|All files(*.*)|*.*")
load object filename$,obj
position object obj,rnd(100),0,rnd(100)

save$=savedialog("Save Object","DarkBasic Object (*.dbo)|*.dbo","media")
save object save$,obj

endfunction

Which works great and give me the extra option to change the name of the model

WindowsXP/SP2, Pentium 4 2.66 GHz, 1GB DDR Ram, Geforce 6600 256MB

Login to post a reply

Server time is: 2024-11-22 22:44:22
Your offset time is: 2024-11-22 22:44:22