Skip to content
⌘ NSIS Forum Archive

Set 1024 space in variable

6 posts

r2du-soft#edited

Set 1024 space in variable

hi
how can set 1024 space in a variable?
i know space code is: " " and for set 10 space in variable i can use:

Var /Global E1
strcpy $E1 "          "
now if i want set to $E1 1024 space must use 1024 $\r$\n or 1024 " " ?
in vb6 i use from this code for set 1024 space in variable:

E1 = Space$(1024)
in finally i how can set 1024 space in variable in nsis?
JasonFriday13#
Loops are your friend:
StrCpy $0 "" ;holds spaces
StrCpy $1 "0" ;holds count
loop:
StrCpy $0 "$0 "
IntOp $1 $1 + 1
IntCmp $1 1024 +1 loop
;$0 has 1024 spaces
Anders#
A loop is only useful if you don't know exactly how many characters you want, if it is constant then just a simple StrCpy probably compresses really well.

But why do you even need 1000+ space characters in a string?
JasonFriday13#
I've stopped asking that question because that person never says what it's needed for. Considering all the other questions that person has asked, this one should have been pretty straight forward to solve.
r2du-soft#
Originally Posted by Anders View Post
A loop is only useful if you don't know exactly how many characters you want, if it is constant then just a simple StrCpy probably compresses really well.

But why do you even need 1000+ space characters in a string?
i ask this question for convert a vb code to nsis:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.

txt = Space$(1024)
but am trying for convert that but every time is goes Fail 🙁


Originally Posted by JasonFriday13 View Post
I've stopped asking that question because that person never says what it's needed for. Considering all the other questions that person has asked, this one should have been pretty straight forward to solve.
i asked the normal questions but sometimes no one answer my questions!!!
i like nsis language and i just want learn nsis language and convert my applications (VB) to nsis because i like that...and my problem for learn nsis is no educational nsis book from learning in iran!
Anders#
Originally Posted by r2du-soft View Post
i ask this question for convert a vb code to nsis
That VB code fills the buffer with spaces as some sort of hack to preallocate memory. You don't need to do that in NSIS.

I have already told you, the System plug-in readme has a GetWindowText example, go look at it before asking about this again!