Archive: variable variables


variable variables
Are variable variables (i.e. that I would be able to use the value of a variable as the name of a variable) possible in NSIS??


Sorry if I misunderstood, what is the possible usage of such a thing?
If I got your point you mean something like get a value to $R0 and then add the value as name of a new variable e.g. var $R0? This is not acceptable in NSIS firstly because of the existence of $ (invalid character).
Could you provide an example on how you'd like to use such a
feature?


You can't create new variables at run time so that wont work, but you can use definitions at caompile time, but I don't think that is what you are looking for.


You can try the NSISArray plugin

-Stu


I have written a macro that downloads individual package components from the web using the InetLoad plug-in. This is it.

!macro dlComp strFile strStatus strFrom strTo strUsrMsg strFlag
StrCmp "${strFile}" "" DL +1
IfFileExists "${strFile}" DLD DL

DL:
Call connectToTheInternet
InetLoad::load /RESUME "xxx" /TRANSLATE "${strStatus}" "Connecting ..." second minute hour s "%dkB (%d%%) of %dkB @ %d.%01dkB/s" "(%d %s%s remaining)" "${strFrom}" "${strTo}" /END
Pop "$DlStatus"
StrCmp "$DlStatus" "OK" DLD
MessageBox MB_ABORTRETRYIGNORE|MB_ICONSTOP "$DlStatus$\r$\n$\r$\n${strUsrMsg}$\r$\n$\r$\n${strDlErrSuffix}" IDRETRY DL IDIGNORE DLD
Quit

DLD:
StrCpy $strDlStatusTmp "str"
StrCpy $strDlStatusTmp "$strDlStatusTmp${strFlag}"
StrCpy $strDlStatusTmp "$strDlStatusTmpDlStatus"
StrCpy ${^strDlStatusTmp} $DlStatus
;MessageBox MB_OK|MB_ICONINFORMATION ${$strDlStatus}
!macroend

I have a few components to download. If a given component is downloaded successfully, the plug-in returns "OK". I would like to assign the value to its corresponding variable (defined with 'Var') and later check their values for further installation tasks.