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.

Newcomers DBPro Corner / Function problems...

Author
Message
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 1st May 2003 08:35
I've got this string... called file$... and I'm loading a file from it... codes like this

load image file$,1

but when I load it (its in a function) it quits the program... O_O why? I have never had this problem b4...
AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 1st May 2003 10:29
I've had that problem before, but DBP works best with a loop.. like this at the beginning of your code.

REPEAT
if MOUSECLICK()=1 or ESCAPEKEY()=1 THEN END
UNTIL FALSE

That should stop the program from ending prematurely.

I hear and I forget. I see and I remember. I do and I understand.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st May 2003 13:11
Replace file$ with the actual file name, just for debugging purposes. If it still crashes, and you know the file name AND path is correct, you got a problem. If it stops crashing, you know your code to populate file$ is wrong.

Thanks in advance.
All the Best,
StevieVee
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st May 2003 13:52
what does your function look like and what does the line look like that uses it in your main loop

example function


matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 1st May 2003 21:50
make sure the filename doesnt have spaces in it
(i had that prob)
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 1st May 2003 22:39
Trust me my way will work, I've done it myself.



Take the above code for example, without the repeat...until loop well, it closes straight away.

I hear and I forget. I see and I remember. I do and I understand.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd May 2003 00:45
Where did you hear that? I've not have any problems with functions since patch 2.

Darthpuff, I've seen that problem before, but with an 'open to read' command. I couldn't fix it either. Any chance we could see a little more code?
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 2nd May 2003 01:43
I have problems with them too, only that in DBP (Not a problem in DB I don't think?) without the loop at the beginning, my functions happen then my program closes, even if I have the 'wait key' command inserted afterwards, it even happens with 'SLEEP #'.

Try using:


I hear and I forget. I see and I remember. I do and I understand.
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 2nd May 2003 01:44
Just to see if it works.

(Is there not a edit post button around? I also miss closing comments off my posts).

I hear and I forget. I see and I remember. I do and I understand.
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 2nd May 2003 02:44 Edited at: 2nd May 2003 02:45
ok here is some code... o_O... you guys can figure it out i hope...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Phoenix
21
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 2nd May 2003 04:25
what do you mean it's in a function do you mean that the command:
load image file$,1
is in the function.
or the value of file$ ?

Peace is but a shadow of its painful past.
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 2nd May 2003 04:45
o_O what.... load image file$,1 is in the function... file$ is found in the loop... I tried using "example.bmp" instead of file and it didn't crash... why is this?

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 2nd May 2003 07:29 Edited at: 2nd May 2003 07:29
you need to check if files nop.dat and noi.dat exists and delete them before you make them.

Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 2nd May 2003 09:51
No I dont...you guys wanna see the other side of the program...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd May 2003 11:59
Is the filename held by file$ a valid image file ?

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd May 2003 15:40
I can't really tell what the problem is, but I can have a few guesses

Instead of passing the value directly from your structure, can you try something like this instead :



I'm currently experiencing a compiler bug that this solves too.
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 3rd May 2003 23:31
I gotta keep $ out of it ... those aren't offically supported by that language... and file$ holds the string "example.bmp" because thats all I have tried opening...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd May 2003 23:56
It's the idea that I'm trying to get across, not the code

Basically, instead of using the 'structure.element' as an argument, extract the value into a simple variable, and use that as the argument instead.
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 4th May 2003 04:59
OHHHHHHH... o_O Thats PB... it needs the whole path + filename and everything to get the file... O_O I'm not redelcaring so theres no problems...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 6th May 2003 06:58
I made file$="example.bmp"... still quite... then I just typed it in and it worked... FACK... how am I going to do this...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 8th May 2003 09:23
oh now that sucks... o_O I thought that if I put a $ on the end of file$ it would not be a reserved word anymore... guess not... there was never a problem in the first place... thanks for pointing out the reserved word Toad... O_O I wasted so long trying to fix a bug that wasn't there... ^_^

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Fluffy Paul
21
Years of Service
User Offline
Joined: 16th Dec 2002
Location: United Kingdom
Posted: 8th May 2003 18:36
Are you willing to simply load a bitmap and make an image from it?

Ending a sentence with a French word is so passé
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 9th May 2003 03:21
I got it fixed... the codes a lil more advanced than that...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 10th May 2003 18:05
Can you post the code fix? It might be advanced but I like to see how problems get solved.
Thanks in advance.

I hear and I forget. I see and I remember. I do and I understand.

Login to post a reply

Server time is: 2024-11-24 13:52:42
Your offset time is: 2024-11-24 13:52:42