Skip to content

Commit e475e9d

Browse files
committed
examples: shorten the periodic output of examples/hot_reload/message.v
1 parent 4877417 commit e475e9d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

examples/hot_reload/message.v

+9-5
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@ import v.live
66

77
struct App {
88
mut:
9-
x int
10-
counter int
9+
x int
10+
c int
1111
}
1212

1313
@[live]
1414
fn print_message(mut app App) {
1515
i := live.info()
16-
println('OK reloads: ${i.reloads_ok:4d} | Total reloads: ${i.reloads:4d} | Hello! Modify this message while the program is running. app: ${voidptr(app)} | app.x: ${app.x:6} | app.counter: ${app.counter:6}')
17-
// app.x = 99 // try changing this to another value, while the program is running ...
18-
app.counter++
16+
println('Hello! Modify this message. OK reloads: ${i.reloads_ok:2d} | Total: ${i.reloads:2d} | app: ${voidptr(app)} | app.c: ${app.c:4} | app.x: ${app.x:12}')
17+
// app.x = app.x * 3 + 1 // try changing this to another value, while the program is running ...
18+
// app.x = 0
19+
app.c++
1920
}
2021

2122
fn main() {
2223
unbuffer_stdout()
24+
println('=============================================================')
25+
println('== Modify the message below, while the program is running: ==')
26+
println('=============================================================')
2327
mut app := &App{}
2428
for {
2529
print_message(mut app)

0 commit comments

Comments
 (0)