Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
qml file at startup
#6
Macro Macro2938
Code:
Copy      Help
str file1="Q:\My QM\qm1.qml"

str s
rget s "Recent Files" "SOFTWARE\GinDi\QM2\Settings"
ARRAY(str) a
s.MultistringToArray(a)
int i found
for i 0 a.len
,a[i].expandpath
,out F"'{a[i]}'"
,if(a[i]~file1) found=1; break
if !found
,a[a.insert(0)]=file1
,s.MultistringFromArray(a)
,rset s "Recent Files" "SOFTWARE\GinDi\QM2\Settings" 0 REG_MULTI_SZ

Member function str.MultistringToArray
Code:
Copy      Help
;/Macro2933
function ARRAY(str)&a

if this.lpstr=0
,a=0
,ret

if this.len=0 or (this.len=1 and this[0]=0)
,a.create
,ret

int j n
lpstr s(this.lpstr) se(s+this.len)
rep
,n+1
,s+len(s)+1
,if(s>=se) break

a.create(n)
s=this.lpstr
for j 0 n
,int i=len(s)
,a[j].left(s i)
,s+i+1
,if(s>=se) break

Member function str.MultistringFromArray
Code:
Copy      Help
function ARRAY(str)&a

if !a
,this.all
,ret

if !a.len
,this=""
,ret

this.all
int i
for i 0 a.len
,str& s=a[i]
,if s.len
,,this.fromn(this this.len s s.len "" 1)
,else
,,this.fromn(this this.len "" 1)


Messages In This Thread
qml file at startup - by ssimop - 07-09-2020, 08:32 AM
RE: qml file at startup - by Gintaras - 07-11-2020, 06:01 AM
RE: qml file at startup - by ssimop - 07-11-2020, 06:17 AM
RE: qml file at startup - by ssimop - 07-11-2020, 08:59 AM
RE: qml file at startup - by Gintaras - 07-11-2020, 10:28 AM
RE: qml file at startup - by Gintaras - 07-11-2020, 12:00 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)