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 / text editor problems

Author
Message
The Master
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location:
Posted: 17th May 2006 00:02 Edited at: 17th May 2006 00:26
so i made this BASIC text editor and it is so simple that alls you do is type the file name and type only one line of text and you click enter it says thank you and press enter and it says what you wrote.
well it says runtime error (file not exist) at line 18
so i'm wondering why it won't work. any help is great.
oh and what is sync on/off and how do you use it thanx

NOTE: please no modification just the answer to my problem.......unless the modification fixes the problem



No Pain No Gain
DELL 800MHZ 1GB RAM PENTIUM 4 MICROSOFT XP SP2
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th May 2006 01:03
nameoffile$ = you haven't assigned a value to this variable

filename$ = "C:\AdamDBP FILE\Text editor v1\" + nameoffile$ + ".dat"


The Master
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location:
Posted: 17th May 2006 01:26
thanx but what do you mean
"nameoffile$ = you haven't assigned a value to this variable"?

No Pain No Gain
DELL 800MHZ 1GB RAM PENTIUM 4 MICROSOFT XP SP2
D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 17th May 2006 04:50
I think what Phealax is telling you is that you must use string concatenation to create a complete string for the variable "filename$". Hense, the use of the "+" sign.

Also, I would recommend checking to see if the user actually entered something at the input other than just pressing the enter key. This way your variable, "nameoffile$" isn't null (empty). You could either make it a default string referencing a default file and path, or just have the user re-enter something until "nameoffile$" is not null.
The Master
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location:
Posted: 17th May 2006 23:41 Edited at: 17th May 2006 23:42
oh i see thanx
but could someone tell me about the sync on/off thing please?


again, thanx

No Pain No Gain
DELL 800MHZ 1GB RAM PENTIUM 4 MICROSOFT XP SP2
D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 18th May 2006 00:27
The sync commands are used to set a constant frame rate used in your program no matter what the computer specs are running it. This is sometimes refered to as the screen refresh rate.

In a game situation there is many different things moving on the screen. Usually, you would have all the actions determined inside of a loop of some sort. During each pass of the loop something is calculated and then repositioned. At the end of each pass of the loop, the sync command updates (redraws) the screen.

Here is a generic example of usage:



Using a sync rate of zero will cause the program to refresh as fast as the system will allow.

There is a speed break point you can reach. This means if the frame rate is set to a speed which the program can not handle then you wont get the actual frame rate specified by the sync rate command. This can be due to limitations of the langauge and poor programming practices.
The Master
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location:
Posted: 19th May 2006 23:33
but in the code after main game loop here, you did sync again?
---
---
---

No Pain No Gain
DELL 800MHZ 1GB RAM PENTIUM 4 MICROSOFT XP SP2

Login to post a reply

Server time is: 2024-11-26 19:51:52
Your offset time is: 2024-11-26 19:51:52