Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
qml file at startup
#1
I wonder whether the following option can work: Suppose that in $My QM$ there exists a very short maim.qml file, which - under certain circumstances - decides which one of another two (namely qm1.qml & qm2.qml) will be further called, loaded, executed. If not, is there another way to select at startup which .qml will be loaded? Any advice much appreciated.
#2
Create exe-macro that opens one of files.
To open a qml file, can be used command line. Or before starting QM change registry value "file" in HKEY_CURRENT_USER\SOFTWARE\GinDi\QM2\Settings.

Macro Macro2930
Code:
Copy      Help
;/exe
str sf
ifk J 1 ;;toggled Scroll Lock
,sf="C:\My QM\qm1.qml"
else
,sf="C:\My QM\qm2.qml"

run "qm.exe" F"L ''{sf}''"
#3
Many thanks indeed! I have already used the solution with registry change, I found it a bit dangerous, since if you forget it and you click on another .qml file, then this value is replaced. Best regards.
#4
I have tested it. Nevertheless, it loads last main.qml used and it opens qm1.qml (or qm2.qml) in file viewer. I would like to use absolutely qm1.qml. Is there any way to overcome it, unless using registry's file string appropriately set, which it works. Many thanks.
#5
Should not show file viewer if file path is in
HKEY_CURRENT_USER\SOFTWARE\GinDi\QM2\Settings:Recent Files
#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)


Forum Jump:


Users browsing this thread: 1 Guest(s)