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.

Program Announcements / DBP_NETLIB - Plugin for Dark Basic Pro - Official Thread

Author
Message
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 17th Jul 2004 07:20
Are you going to add the screenshot command to the next official version?

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 17th Jul 2004 07:21 Edited at: 17th Jul 2004 07:39
@MasterInsane
try this code:


The function there will strip the file name off the end of any valid path, regardless of the length of the path.



@LIT yes, at some point


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 17th Jul 2004 18:50
Hmm, I suppose I probably should've thought of that, heheh. Oh well, maybe I will next time. Thanks.

MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 17th Jul 2004 19:07
Hmm...for some reason using that caused my load object routine to go into an infinite loop, while using the gen_InputBox() I was using before doesn't...strange, but come to think of it InputBox() will probably work better for this, because if you know the object name, but don't actually have it, you could still theoretically load the object...not yet, but that's how I intend to have it in the future.

Still, thanks for you help.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 17th Jul 2004 22:24
no problem. That code snippet I posted is an infinite loop so if you used it as is you could have problems. I was really just intending to demonstrate the function that strips the filenames of the end of paths. If you use it in your code, omit the do-loop section


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
harggood
21
Years of Service
User Offline
Joined: 9th Apr 2003
Location: the forest
Posted: 18th Jul 2004 03:10
Quote: "best bet is to use instrrev() function to look at the long path name and find the position of the "\" prior to the actual file name, then use str_Mid to return just the file name back to you..."


That works for me. Also, I've found that it helps to do something like this at the beginning of the program:

homedir$=get dir$()

Before and after accessing the files:

set dir homedir$

Thanks for the awesome plugin. Keep up the good work.

Awfuldark Forest
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jul 2004 04:14
Thanks!
I am glad that people are finding this plugin useful!


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 18th Jul 2004 06:21 Edited at: 18th Jul 2004 06:28
Quote: "
no problem. That code snippet I posted is an infinite loop so if you used it as is you could have problems. I was really just intending to demonstrate the function that strips the filenames of the end of paths. If you use it in your code, omit the do-loop section
"


Heheh, yes, I knew that. I didn't keep the do-loop and it still made me infinitely loop. Something about my while success = 0 loop wasn't working anymore for some reason. It was like it never set success to 1 even though I tried putting it all over the while loop just to make sure it did. Hmm...maybe it's a bug? I doubt it, but just in case I'll post the routine in question in an edit (I need to put the open file dialog back in).

Edit: Here's that code. It works just fine if I use the gen_InputBox() but does not otherwise.



Thanks again for your help.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jul 2004 07:02
Quote: "Heheh, yes, I knew that"

Sorry MI, I wasn't trying to insult - i was trying to be complete

Anyway, I am looking at your code but I am not finding anything crazy to cause it to loop forever other than the outter WHILE. Are you sure the Success=1 is in the correct spot and there are NO variable name typos?


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 18th Jul 2004 09:39 Edited at: 18th Jul 2004 09:39
Make "Success = 0" just before you create the While loop, my best guess is that it's a scoping issue.


"Computers are useless they can only give you answers."
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jul 2004 10:52
heh, I was thinking that too
nice Ex


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 18th Jul 2004 11:13 Edited at: 18th Jul 2004 11:15
Hmmm, I tried that, no luck.

It does load the object so I know it's running the while loop, it's just not setting success = 1. Similarly, I tried making a global variable and using that, and just resetting it to 0 at the start of the function, but that didn't work either. I'm almost positive I'm setting success to 1 in a place that would work (at the end of the if file exist(tempfilename$) = 1 and success = 0, before the endif).

I even tried enclosing the gen_OpenFileDialog within an "if success = 0" statement and it still runs.

Then, I tried putting success = 1 all around the while loop. Still no luck.

Hmm...this is confusing. Any other ideas?

EDIT: It works just fine if I replace the gen_OpenFileDialog stuff with gen_InputBox...

Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 18th Jul 2004 11:15
Use our Var Watcher to monitor the values of Success!


"Computers are useless they can only give you answers."
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 18th Jul 2004 11:19 Edited at: 18th Jul 2004 11:26
Hmm...that's a good idea, heheh. I'll do that.

EDIT: Hmm...well, success is equal to 1. Even at the end of the function, success = 1. But it still opens the dialog again.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jul 2004 11:37
does it have to loop? Could you replace WHILE with IF ?

And neato Exeat, I thought to mention the variable watcher but I thought he was already using it




DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 18th Jul 2004 14:22
Yeah, it needs to loop so that if the user selects something wrong he doesn't have to press "o" again to load an object. I had it like that for a while and it got annoying.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jul 2004 15:58
well, what does the VW say about your "success" variable?


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Aug 2004 04:12 Edited at: 3rd Aug 2004 04:25
Powersoft, what happended in irc?
Your code in the pastebin had a few problems.
I'll post here if you dont make it back to irc.

I pasted your pastebin code here so it doesn't get deleted. There are a few things wrong. If you want me to help you fix it then post here



DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo

Login to post a reply

Server time is: 2024-11-24 15:11:15
Your offset time is: 2024-11-24 15:11:15