-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMESSAGE.BAS
76 lines (51 loc) · 1.1 KB
/
MESSAGE.BAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
' MESSAGE.BAS - Display a Message
' Copyright (c) 2022 Ercan Ersoy
' This code licensed by MIT License.
DECLARE SUB updatemessage ()
DECLARE SUB displaymessage ()
DIM choice AS INTEGER
DIM SHARED message AS STRING * 512
SCREEN 0
DO
CLS
OPEN "MESSAGE.DAT" FOR BINARY ACCESS READ AS #1 LEN = LEN(message)
GET #1, 1, message
CLOSE #1
PRINT "Display a Message"
PRINT "Copyright (c) 2022 Ercan Ersoy"
PRINT "1) Display the Message"
PRINT "2) Update the Message"
PRINT "3) Exit"
choice = VAL(INPUT$(1))
SELECT CASE choice
CASE 1:
displaymessage
CASE 2:
updatemessage
CASE 3:
CLS
END
CASE ELSE:
SOUND 50, 1
PRINT "Wrong choice!"
END SELECT
LOOP
SUB displaymessage
CLS
PRINT "The Message:"
PRINT
PRINT message
PRINT
PRINT "Press any key to continue!"
SLEEP
END SUB
SUB updatemessage
CLS
INPUT "Message: ", message
OPEN "MESSAGE.DAT" FOR BINARY ACCESS WRITE AS #1 LEN = LEN(message)
PUT #1, 1, message
CLOSE #1
PRINT
PRINT "Press any key to continue!"
SLEEP
END SUB