(AGK version: 108.24)
Submitted: 2015-03-12 12:19:14
SetDisplayAspect( 4.0/3.0 )

global value = 1
global write as Integer
global read as Integer
global StrVal as String
global StrVal2 as String

AddVirtualButton ( 1, 50, 50, 5 )
AddVirtualButton ( 2, 50, 70, 5 )

do

if GetVirtualButtonPressed ( 1 ) = 1
    write = OpenToWrite("save.txt" ,0)
    StrVal = str(value)
    WriteLine (write,StrVal)
    Closefile(write)
endif

if GetVirtualButtonPressed ( 2 ) = 1
    read = OpenToRead("save.txt")
    StrVal2 = ReadLine(read)
    Closefile(read)
endif

Print(StrVal2)

 Sync()
loop
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.