Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use QM function to load and modify files of type .psl
#14
not sure what your trying to do but this is all wrong
s.setfile(F"$desktop$\abc_edit.psl")
there is no need for F parameter there
i think your asking how to edit more than 1 file at a time if so

this would be easiest way for you


Code:
Copy      Help
str s1
ARRAY(str) a; int i
if OpenSaveDialog(0 0 "" "" 0 "" 0 a)  ;;use array so can select multiple files to make changes to
,for(i 0 a.len) 
,,s1.getfile(a[i])l;; loads each file selected
,,s1.findreplace("select partition 0" "select partition 1")
,,out s1;; use this first to make sure your code is correct
,,;s.setfile(a[i])then uncomment this  to save change made



i just noticed that there was an error in previous code  you were trying
str s1
if OpenSaveDialog(0 s1 "psl files[]*.psl")
,;out s1
,str pt
,inp pt
,str s.getfile(s1);; load the file into a string so you can work with it
,
,s.findreplace("select partition" F"select partition {pt}")<--------------------- this line is incorrect first part of findreplace should be "select partition 0"
,out s
,OpenSaveDialog(1 s1 "psl files[]*.psl")
,s.setfile(s1)
otherwise your would end up with this
select partition 1 0 being saved


Messages In This Thread
RE: use QM function to load and modify files of type .psl - by Kevin - 08-25-2018, 10:24 PM

Forum Jump:


Users browsing this thread: 9 Guest(s)