Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save Variables in .txt file without tabbing out of actual window
#4
Macro Macro109
Code:
Copy      Help
int k c m d
k=1; c=2; m=3; d=4 ;;example values

str sData sFile.expandpath("$documents$\Kills.txt")
int k2(k) c2(c) m2(m) d2(d)
if FileExists(sFile)
,sData.getfile(sFile)
,ARRAY(str) a
,if(findrx(sData "^Matches: (\d+)[]Kills: (\d+)[]Chickendinners: (\d+)[]Deaths: (\d+)[]$" 0 0 a)<0) end "invalid file format"
,m2+val(a[1]); k2+val(a[2]); c2+val(a[3]); d2+val(a[4]);

sData=F"Matches: {m2}[]Kills: {k2}[]Chickendinners: {c2}[]Deaths: {d2}[]"
sData.setfile(sFile)

out sData ;;delete this line


Messages In This Thread
RE: Save Variables in .txt file without tabbing out of actual window - by Gintaras - 12-27-2018, 05:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)