| |

VerySource

 Forgot password?
 Register
Search
View: 867|Reply: 7

Minor problems with keeping score records in mini games

[Copy link]

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-14 16:20:02
| Show all posts |Read mode
rt
Made a small game, the score record only saved the top three
The player saves the score after the end of the round. If the score reaches the top three records, the original record is overwritten. The problem now is to restart the game after the .exe file is generated.
Reply

Use magic Report

1

Threads

21

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 Great Britain

Post time: 2020-1-18 13:54:02
| Show all posts
Where did you keep your records?

File
2. Database
Reply

Use magic Report

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-1-18 15:36:02
| Show all posts
I saved it to a file
Reply

Use magic Report

1

Threads

21

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 Great Britain

Post time: 2020-1-18 19:54:01
| Show all posts
Then you must read from the file
1. Check your function for reading files
2. Is the path you read the file right

You don't generate exe, everything goes well when you tune it in the environment? Is it correct to re-run the read data after each change of data?
Reply

Use magic Report

0

Threads

34

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-1-19 11:36:02
| Show all posts
Dim n1, n2, n3 'test it
Private Sub Form_Load () 'read points
If Dir ("c:\a.txt") = "" Then Exit Sub
    Open "c:\a.txt" For Input As 1
        Input # 1, n1, n2, n3
    Close
    Text1 = n1: Text2 = n2: Text3 = n3
End Sub

Private Sub Form_Unload (Cancel As Integer) '
    Open "c:\a.txt" For Output As 1
        Write # 1, Text1, Text2, Text3
    Close
End Sub
Reply

Use magic Report

0

Threads

21

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-1-21 09:27:02
| Show all posts
Did you delete the record in the file every time? ?
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-4-30 18:45:01
| Show all posts
Check the file, if the file is written and not closed after the file is opened, the file will be emptied
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-5-10 16:00:01
| Show all posts
Not bad learned
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list