Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing string to file from Array.
#1
I am trying to setfile a str.
Not sure why it's not working. Code - output - and file, below:

CODE:
Macro Macro7
Code:
Select All      Help
out
ARRAY(int) a; int i; str sc sn
out "[][9]ALL VISIBLE WINDOWS"
win("" "" "" 0 0 0 a)
for(i 0 a.len)
,sc.getwinclass(a[i])
,sn.getwintext(a[i])
,out "%i '%s' '%s'" a[i] sc sn
,sn.setfile("C:\wn.txt" 0 -1)

OUTPUT:

Start

QM TOOLBAR
Quick Macros - Main - [Macro6]
QM Help
Quick Macros Forum • Index page - Google Chrome
Local Disk (CSmile
UT
OC
Program Manager

FILE:

Program Manager
Reply
#2
you need to store all the variables into 1 string before saving.
try this
Function Function10
Code:
Select All      Help
out
ARRAY(int) a; int i; str sc sn
out "[][9]ALL VISIBLE WINDOWS"
win("" "" "" 0 0 0 a)
for(i 0 a.len)
,sc.getwinclass(a[i])
,sn.getwintext(a[i])
,str ft=F"{a[i]} '{sc}' '{sn}'"
,out ft
,ft.setfile("C:\wn.txt" -1 -1 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)